Problem Description

This page will help you deal with the issue when the KLOC is being displayed as 0 on the dashboard.

Applicable in CAST Version
Release
Yes/No
8.3.x(tick)
Step by Step scenario
  1. Run full snapshot
  2. Open CED
Action Plan
  1. Check if the application KLOC is greater or equal to 1KLOC, refer to Get the KLOC.

    As per investigation and feedback from R&D, decision not to fix this for now is based on the assumption that real life applications are larger than 1kLOC.

    In order to verify the value of KLOC, do the following:

    1. Get the id of your snapshot by running the following query :

      select * from dss_snapshots

      example of query results :

      1;3;"2016-09-02 00:00:00";3;"1607 FINAL Onboarding on 201609020312";"";"2016-09-02 04:26:39.276826";"2016-09-02 04:22:28.315764";"2016-09-02 04:28:49.553993";2;0;1;"7.1.0.3";;"EFP"


    2. Get the KLOC value.

      select KLOC from
      (
      
      SELECT cur.metric_id, 
             cur.value/1000 as kloc, 
             prev.value/100, 
             Sign(cur.value - prev.value) 
      FROM   ( (SELECT r1.metric_id             AS METRIC_ID, 
                     Sum(r1.metric_num_value) AS VALUE 
              FROM   dss_objects ap, 
                     dss_date_snapshot d, 
                     dss_links dl, 
                     dss_metric_results r1 ,
                     dss_snapshots ds
              WHERE  dl.previous_object_id = 2 
      	       AND ds.snapshot_id = 1
                     AND dl.next_object_id = ap.object_id 
                     AND ap.object_type_id = -102 
                     AND dl.link_type_id = 1 
                     AND d.application_id = ap.object_id 
                    -- AND d.text_date = '201609020000' 
                     AND r1.object_id = ap.object_id 
                     AND r1.metric_value_index = 1 
                     AND r1.metric_id = 10201 
                     AND r1.snapshot_id = d.snapshot_id 
              GROUP  BY r1.metric_id) cur 
               LEFT JOIN (SELECT r1.metric_id             AS METRIC_ID, 
                                 Sum(r1.metric_num_value) AS VALUE 
                          FROM   dss_objects ap, 
                                 dss_date_snapshot d, 
                                 dss_links dl, 
                                 dss_metric_results r1, 
                                 dss_snapshots ds
                          WHERE  dl.previous_object_id = 2 
                                 AND dl.next_object_id = ap.object_id 
                                 AND ap.object_type_id = -102 
                                 AND dl.link_type_id = 1 
                                 AND d.application_id = ap.object_id 
                                 AND ds.snapshot_id = 1
                                 --AND d.text_date = '201609020000' 
                                 AND r1.object_id = ap.object_id 
                                 AND r1.metric_value_index = 1 
                                 AND r1.metric_id = 10201 
                                 AND r1.snapshot_id = d.snapshot_id 
                          GROUP  BY r1.metric_id) prev 
                      ON cur.metric_id = prev.metric_id ) 
      UNION ALL 
      SELECT cur.metric_id, 
             cur.value, 
             prev.value, 
             Sign(cur.value - prev.value) 
      FROM   ( (SELECT r1.metric_id             AS METRIC_ID, 
                     Sum(r1.metric_num_value) AS VALUE 
              FROM   dss_objects ap, 
                     dss_date_snapshot d, 
                     dss_links dl, 
                     dss_metric_results r1,
                     dss_snapshots ds
              WHERE  dl.previous_object_id = 2 
                     AND dl.next_object_id = ap.object_id 
                     AND ap.object_type_id = -102 
                     AND dl.link_type_id = 1 
                     AND d.application_id = ap.object_id 
                     --AND d.text_date = '201609020000' 
                     AND ds.snapshot_id = 1
                     AND r1.object_id = ap.object_id 
                     AND r1.metric_value_index = 1 
                     AND r1.metric_id IN( 10201 ) 
                     AND r1.snapshot_id = d.snapshot_id 
              GROUP  BY r1.metric_id) cur 
               LEFT JOIN (SELECT r1.metric_id             AS METRIC_ID, 
                                 Sum(r1.metric_num_value) AS VALUE 
                          FROM   dss_objects ap, 
                                 dss_date_snapshot d, 
                                 dss_links dl, 
                                 dss_metric_results r1,
                                 dss_snapshots ds
                          WHERE  dl.previous_object_id = 2 
                                 AND dl.next_object_id = ap.object_id 
                                 AND ap.object_type_id = -102 
                                 AND dl.link_type_id = 1 
                                 AND d.application_id = ap.object_id 
                                 --AND d.text_date = '201609020000' 
                                 AND ds.snapshot_id = 1
                                 AND r1.object_id = ap.object_id 
                                 AND r1.metric_value_index = 1 
                                 AND r1.metric_id IN( 10201 ) 
                                 AND r1.snapshot_id = d.snapshot_id 
                          GROUP  BY r1.metric_id) prev 
                      ON cur.metric_id = prev.metric_id ) 
      
      
             )A limit 1

      Example of query results

      0.6848166666667

      If the above query, returns the value of the metric as less than one, then it's normal behavior to get the KLOC as 0, when the value is rounded up.

  2. If it's not the case then it's expected to get 0, since the number of KLOC is the number per 1000 LOC and is rounded up to displayed as 0 when the KLOC is calculated to be less than 1
  3. If this action plan don't resolve or explain your issue, please contact CAST Technical Support and provide the relevant input:

Relevant input

  1. Screenshot showing the issue
  2. Sherlock export with the following options: Export Logs (feature checked by default), Export Configuration files (feature checked by default), Export Computer Environment (feature checked by default),Export CAST Bases, Source code
Notes / Comments


Related Pages