소스 검색

compression for distribution graphs added.

avkonst 11 년 전
부모
커밋
c69d2e5429

+ 76 - 5
mainline/ext/std/tools/view.py

@@ -25,15 +25,20 @@ import mpp.cout
 class Plugin(mpp.api.Plugin, mpp.api.IConfigurable, mpp.api.IRunable):
     
     def declare_configuration(self, parser):
-        parser.add_option("--format", "--ft", default='txt', choices=['txt', 'xml', 'python'], help="Format of the output data. "
+        parser.add_option("--format", "--ft", default='txt', choices=['txt', 'xml', 'python'],
+                          help="Format of the output data. "
                           "Possible values are 'xml', 'txt' or 'python' [default: %default]")
         parser.add_option("--nest-regions", "--nr", action="store_true", default=False,
                           help="If the option is set (True), data for regions is exported in the form of a tree. "
                           "Otherwise, all regions are exported in plain list. [default: %default]")
+        parser.add_option("--max-distribution-rows", "--mdr", type=int, default=20,
+                          help="Maximum number of rows in distribution tables. "
+                               "If it is set to 0, the tool does not optimize the size of distribution tables [default: %default]")
     
     def configure(self, options):
         self.out_format = options.__dict__['format']
         self.nest_regions = options.__dict__['nest_regions']
+        self.dist_columns = options.__dict__['max_distribution_rows']
 
     def run(self, args):
         loader_prev = self.get_plugin_loader().get_plugin('mpp.dbf').get_loader_prev()
@@ -45,11 +50,16 @@ class Plugin(mpp.api.Plugin, mpp.api.IConfigurable, mpp.api.IRunable):
         else:
             paths = args
         
-        (result, exit_code) = export_to_str(self.out_format, paths, loader, loader_prev, self.nest_regions)
+        (result, exit_code) = export_to_str(self.out_format,
+                                            paths,
+                                            loader,
+                                            loader_prev,
+                                            self.nest_regions,
+                                            self.dist_columns)
         print result
         return exit_code
 
-def export_to_str(out_format, paths, loader, loader_prev, nest_regions):
+def export_to_str(out_format, paths, loader, loader_prev, nest_regions, dist_columns):
     exit_code = 0
     result = ""
     if out_format == 'xml':
@@ -75,6 +85,7 @@ def export_to_str(out_format, paths, loader, loader_prev, nest_regions):
         if aggregated_data_prev != None:
             aggregated_data_tree = append_diff(aggregated_data_tree,
                                            aggregated_data_prev.get_data_tree())
+        aggregated_data_tree = compress_dist(aggregated_data_tree, dist_columns)
         
         file_data = loader.load_file_data(path)
         file_data_tree = {}
@@ -203,6 +214,63 @@ def append_diff_list(main_list, prev_list):
                        '__diff__':merged_list[metric]['__diff__']})
     return result
 
+def compress_dist(data, columns):
+    if columns == 0:
+        return data
+    
+    for namespace in data.keys():
+        for field in data[namespace].keys():
+            metric_data = data[namespace][field]
+            distr = metric_data['distribution-bars']
+            columns = float(columns) # to trigger floating calculations
+            
+            
+            new_dist = []
+            remaining_count = metric_data['count']
+            next_consume = None
+            next_bar = None
+            for (ind, bar) in enumerate(distr):
+                if next_bar == None:
+                    # start new bar
+                    next_bar = {'count': bar['count'],
+                                'ratio': bar['ratio'],
+                                'metric_s': bar['metric'],
+                                'metric_f': bar['metric']}
+                    if '__diff__' in bar.keys():
+                        next_bar['__diff__'] = bar['__diff__']
+                    next_consume = int(round(remaining_count/ (columns - len(new_dist))))
+                else:
+                    # merge to existing bar
+                    next_bar['count'] += bar['count']
+                    next_bar['ratio'] += bar['ratio']
+                    next_bar['metric_f'] = bar['metric']
+                    if '__diff__' in bar.keys():
+                        next_bar['__diff__'] += bar['__diff__']
+                
+                next_consume -= bar['count']
+                if (next_consume <= 0 # consumed enough
+                    or (ind + 1) == len(distr)): # or the last bar
+                    # append to new distribution
+                    if isinstance(next_bar['metric_s'], float):
+                        next_bar['metric_s'] = "{0:.4f}".format(next_bar['metric_s'])
+                        next_bar['metric_f'] = "{0:.4f}".format(next_bar['metric_f'])
+                    else:
+                        next_bar['metric_s'] = str(next_bar['metric_s'])
+                        next_bar['metric_f'] = str(next_bar['metric_f'])
+                    if next_bar['metric_s'] == next_bar['metric_f']:
+                        next_bar['metric'] = next_bar['metric_s']
+                    else:
+                        next_bar['metric'] = next_bar['metric_s'] + "-" + next_bar['metric_f']
+                    del next_bar['metric_s']
+                    del next_bar['metric_f']
+                    new_dist.append(next_bar)
+                    remaining_count -= next_bar['count']
+                    next_bar = None
+                    # check that consumed all
+                    assert((ind + 1) != len(distr) or remaining_count == 0)
+            data[namespace][field]['distribution-bars'] = new_dist
+    return data
+
 def cout_txt_regions(path, regions, indent = 0):
     for region in regions:
         details = [
@@ -280,8 +348,10 @@ def cout_txt(data):
                 diff_str = ' [{0:{1}}]'.format(diff_data['count'], '+' if diff_data['count'] >= 0 else '')
             count_str_len  = len(str(measured))
             details.append(('Distribution', str(measured) + diff_str + ' files/regions measured'))
-            details.append(('  Metric value', 'Ratio : Number of files/regions'))
+            details.append(('  Metric value', 'Ratio : R-sum : Number of files/regions'))
+            sum_ratio = 0
             for bar in data['aggregated-data'][namespace][field]['distribution-bars']:
+                sum_ratio += bar['ratio']
                 diff_str = ""
                 if '__diff__' in bar.keys():
                     diff_str = ' [{0:{1}}]'.format(bar['__diff__'], '+' if bar['__diff__'] >= 0 else '')
@@ -294,7 +364,8 @@ def cout_txt(data):
                 count_str = str(bar['count'])
                 count_str = ((" " * (count_str_len - len(count_str))) + count_str + diff_str + "\t")
                 details.append((metric_str,
-                                "{0:.3f}".format(bar['ratio']) + " : " + count_str + ('|' * int(round(bar['ratio']*100)))))
+                                "{0:.3f}".format(bar['ratio']) + " : " + "{0:.3f}".format(sum_ratio) +  " : " +
+                                count_str + ('|' * int(round(bar['ratio']*100)))))
             mpp.cout.notify(data['info']['path'],
                     '', # no line number
                     mpp.cout.SEVERITY_INFO,

+ 8 - 8
mainline/mpp/api.py

@@ -17,7 +17,6 @@
 #    along with Metrix++.  If not, see <http://www.gnu.org/licenses/>.
 #
 
-import logging
 import os.path
 import mpp.internal.dbwrap
 
@@ -70,17 +69,18 @@ class LoadableData(Data):
         self.changed_namespaces = []
 
     def load_namespace(self, namespace):
-        if self.region_id == None and self.loader.get_namespace(namespace).are_regions_supported() == True:
+        namespace_obj = self.loader.get_namespace(namespace)
+        if namespace_obj == None:
             return
-        try:
-            row = self.loader.db.get_row(namespace, self.file_id, self.region_id)
-        except Exception:
-            logging.debug("No data in the database for namespace: " + namespace)
+        regions_supported = namespace_obj.are_regions_supported()
+        if ((self.region_id == None and regions_supported == True) or 
+            (self.region_id != None and regions_supported == False)):
             return
+        row = self.loader.db.get_row(namespace, self.file_id, self.region_id)
         if row == None:
-            return 
+            return
         for column_name in row.keys():
-            packager = self.loader.get_namespace(namespace).get_field_packager(column_name)
+            packager = namespace_obj.get_field_packager(column_name)
             if packager == None:
                 continue
             if row[column_name] == None:

+ 4 - 0
mainline/tests/general/test_basic/test_help_view_default_stdout.gold.txt

@@ -22,3 +22,7 @@ Options:
   --nest-regions, --nr  If the option is set (True), data for regions is
                         exported in the form of a tree. Otherwise, all regions
                         are exported in plain list. [default: False]
+  --max-distribution-rows=MAX_DISTRIBUTION_ROWS, --mdr=MAX_DISTRIBUTION_ROWS
+                        Maximum number of rows in distribution tables. If it
+                        is set to 0, the tool does not optimize the size of
+                        distribution tables [default: 20]

+ 5 - 5
mainline/tests/general/test_basic/test_std_general_metrics_view_nest_per_file_stdout.gold.txt

@@ -56,7 +56,7 @@
 	Maximum        : None
 	Total          : 0.0
 	Distribution   : 0 files/regions measured
-	  Metric value : Ratio : Number of files/regions
+	  Metric value : Ratio : R-sum : Number of files/regions
 
 ./simple.cpp:: info: Overall metrics for 'std.general:proctime' metric
 	Average        : 0.01
@@ -64,8 +64,8 @@
 	Maximum        : 0.01
 	Total          : 0.01
 	Distribution   : 1 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	        0.0100 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	        0.0100 : 1.000 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.general:size' metric
 	Average        : 487.0
@@ -73,7 +73,7 @@
 	Maximum        : 487
 	Total          : 487.0
 	Distribution   : 1 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	           487 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	           487 : 1.000 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 

+ 5 - 5
mainline/tests/general/test_basic/test_std_general_metrics_view_txt_stdout.gold.txt

@@ -4,7 +4,7 @@
 	Maximum        : None
 	Total          : 0.0
 	Distribution   : 0 files/regions measured
-	  Metric value : Ratio : Number of files/regions
+	  Metric value : Ratio : R-sum : Number of files/regions
 
 :: info: Overall metrics for 'std.general:proctime' metric
 	Average        : 0.01
@@ -12,8 +12,8 @@
 	Maximum        : 0.01
 	Total          : 0.01
 	Distribution   : 1 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	        0.0100 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	        0.0100 : 1.000 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 :: info: Overall metrics for 'std.general:size' metric
 	Average        : 487.0
@@ -21,8 +21,8 @@
 	Maximum        : 487
 	Total          : 487.0
 	Distribution   : 1 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	           487 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	           487 : 1.000 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 :: info: Directory content:
 	Directory      : .

+ 21 - 21
mainline/tests/general/test_basic/test_std_lines_metrics_view_nest_per_file_stdout.gold.txt

@@ -84,14 +84,14 @@
 	Maximum        : 12
 	Total          : 44.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.125 : 1	|||||||||||||
-	             3 : 0.125 : 1	|||||||||||||
-	             4 : 0.125 : 1	|||||||||||||
-	             5 : 0.250 : 2	|||||||||||||||||||||||||
-	             7 : 0.125 : 1	|||||||||||||
-	             8 : 0.125 : 1	|||||||||||||
-	            12 : 0.125 : 1	|||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.125 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 0.250 : 1	|||||||||||||
+	             4 : 0.125 : 0.375 : 1	|||||||||||||
+	             5 : 0.250 : 0.625 : 2	|||||||||||||||||||||||||
+	             7 : 0.125 : 0.750 : 1	|||||||||||||
+	             8 : 0.125 : 0.875 : 1	|||||||||||||
+	            12 : 0.125 : 1.000 : 1	|||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.code.lines:code' metric
 	Average        : 5.125
@@ -99,13 +99,13 @@
 	Maximum        : 11
 	Total          : 41.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.125 : 1	|||||||||||||
-	             3 : 0.125 : 1	|||||||||||||
-	             4 : 0.250 : 2	|||||||||||||||||||||||||
-	             5 : 0.125 : 1	|||||||||||||
-	             7 : 0.250 : 2	|||||||||||||||||||||||||
-	            11 : 0.125 : 1	|||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.125 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 0.250 : 1	|||||||||||||
+	             4 : 0.250 : 0.500 : 2	|||||||||||||||||||||||||
+	             5 : 0.125 : 0.625 : 1	|||||||||||||
+	             7 : 0.250 : 0.875 : 2	|||||||||||||||||||||||||
+	            11 : 0.125 : 1.000 : 1	|||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.code.lines:preprocessor' metric
 	Average        : 0.0
@@ -113,8 +113,8 @@
 	Maximum        : 0
 	Total          : 0.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 1.000 : 8	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 1.000 : 1.000 : 8	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ./simple.cpp:: info: Overall metrics for 'std.code.lines:comments' metric
 	Average        : 0.5
@@ -122,9 +122,9 @@
 	Maximum        : 2
 	Total          : 4.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.625 : 5	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.250 : 2	|||||||||||||||||||||||||
-	             2 : 0.125 : 1	|||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.625 : 0.625 : 5	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.250 : 0.875 : 2	|||||||||||||||||||||||||
+	             2 : 0.125 : 1.000 : 1	|||||||||||||
 
 

+ 21 - 21
mainline/tests/general/test_basic/test_std_lines_metrics_view_txt_stdout.gold.txt

@@ -4,14 +4,14 @@
 	Maximum        : 12
 	Total          : 44.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.125 : 1	|||||||||||||
-	             3 : 0.125 : 1	|||||||||||||
-	             4 : 0.125 : 1	|||||||||||||
-	             5 : 0.250 : 2	|||||||||||||||||||||||||
-	             7 : 0.125 : 1	|||||||||||||
-	             8 : 0.125 : 1	|||||||||||||
-	            12 : 0.125 : 1	|||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.125 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 0.250 : 1	|||||||||||||
+	             4 : 0.125 : 0.375 : 1	|||||||||||||
+	             5 : 0.250 : 0.625 : 2	|||||||||||||||||||||||||
+	             7 : 0.125 : 0.750 : 1	|||||||||||||
+	             8 : 0.125 : 0.875 : 1	|||||||||||||
+	            12 : 0.125 : 1.000 : 1	|||||||||||||
 
 :: info: Overall metrics for 'std.code.lines:code' metric
 	Average        : 5.125
@@ -19,13 +19,13 @@
 	Maximum        : 11
 	Total          : 41.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.125 : 1	|||||||||||||
-	             3 : 0.125 : 1	|||||||||||||
-	             4 : 0.250 : 2	|||||||||||||||||||||||||
-	             5 : 0.125 : 1	|||||||||||||
-	             7 : 0.250 : 2	|||||||||||||||||||||||||
-	            11 : 0.125 : 1	|||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.125 : 0.125 : 1	|||||||||||||
+	             3 : 0.125 : 0.250 : 1	|||||||||||||
+	             4 : 0.250 : 0.500 : 2	|||||||||||||||||||||||||
+	             5 : 0.125 : 0.625 : 1	|||||||||||||
+	             7 : 0.250 : 0.875 : 2	|||||||||||||||||||||||||
+	            11 : 0.125 : 1.000 : 1	|||||||||||||
 
 :: info: Overall metrics for 'std.code.lines:preprocessor' metric
 	Average        : 0.0
@@ -33,8 +33,8 @@
 	Maximum        : 0
 	Total          : 0.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 1.000 : 8	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 1.000 : 1.000 : 8	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 :: info: Overall metrics for 'std.code.lines:comments' metric
 	Average        : 0.5
@@ -42,10 +42,10 @@
 	Maximum        : 2
 	Total          : 4.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.625 : 5	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.250 : 2	|||||||||||||||||||||||||
-	             2 : 0.125 : 1	|||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.625 : 0.625 : 5	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.250 : 0.875 : 2	|||||||||||||||||||||||||
+	             2 : 0.125 : 1.000 : 1	|||||||||||||
 
 :: info: Directory content:
 	Directory      : .

+ 1 - 1
mainline/tests/general/test_basic/test_view_format_view_python_stdout.gold.txt

@@ -1 +1 @@
-{'export': [{'data: {'info': {'path': '', 'id': 1}, 'file-data': {}, 'subfiles': [], 'subdirs': [u'.'], 'aggregated-data': {'std.code.complexity': {'cyclomatic': {'count': 4, 'distribution-bars': [{'count': 3, 'metric': 1, 'ratio': 0.75}, {'count': 1, 'metric': 3, 'ratio': 0.25}], 'avg': 1.5, 'min': 1, 'max': 3, 'total': 6.0}}}}}]}
+{'export': [{'data: {'info': {'path': '', 'id': 1}, 'file-data': {}, 'subfiles': [], 'subdirs': [u'.'], 'aggregated-data': {'std.code.complexity': {'cyclomatic': {'count': 4, 'distribution-bars': [{'count': 3, 'ratio': 0.75, 'metric': '1'}, {'count': 1, 'ratio': 0.25, 'metric': '3'}], 'avg': 1.5, 'min': 1, 'max': 3, 'total': 6.0}}}}}]}

+ 3 - 3
mainline/tests/general/test_basic/test_view_format_view_txt_stdout.gold.txt

@@ -4,9 +4,9 @@
 	Maximum        : 3
 	Total          : 6.0
 	Distribution   : 4 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             1 : 0.750 : 3	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             3 : 0.250 : 1	|||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             1 : 0.750 : 0.750 : 3	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             3 : 0.250 : 1.000 : 1	|||||||||||||||||||||||||
 
 :: info: Directory content:
 	Directory      : .

+ 18 - 18
mainline/tests/general/test_std_code_cpp/test_parser_view_files_stdout.gold.txt

@@ -43,8 +43,8 @@
 	Maximum        : 0
 	Total          : 0.0
 	Distribution   : 3 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 1.000 : 3	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 1.000 : 1.000 : 3	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ./operator_test.hpp:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -427,10 +427,10 @@
 	Maximum        : 2
 	Total          : 4.0
 	Distribution   : 51 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.941 : 48	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.039 :  2	||||
-	             2 : 0.020 :  1	||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.941 : 0.941 : 48	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.039 : 0.980 :  2	||||
+	             2 : 0.020 : 1.000 :  1	||
 
 ./test.c:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -648,10 +648,10 @@
 	Maximum        : 2
 	Total          : 6.0
 	Distribution   : 24 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.833 : 20	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.083 :  2	||||||||
-	             2 : 0.083 :  2	||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.833 : 0.833 : 20	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.083 : 0.917 :  2	||||||||
+	             2 : 0.083 : 1.000 :  2	||||||||
 
 ./test2.cpp:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -705,10 +705,10 @@
 	Maximum        : 2
 	Total          : 3.0
 	Distribution   : 4 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.500 : 2	||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.250 : 1	|||||||||||||||||||||||||
-	             2 : 0.250 : 1	|||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.500 : 0.500 : 2	||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.250 : 0.750 : 1	|||||||||||||||||||||||||
+	             2 : 0.250 : 1.000 : 1	|||||||||||||||||||||||||
 
 ./test3.cpp:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -774,9 +774,9 @@
 	Maximum        : 2
 	Total          : 4.0
 	Distribution   : 4 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.250 : 1	|||||||||||||||||||||||||
-	             1 : 0.500 : 2	||||||||||||||||||||||||||||||||||||||||||||||||||
-	             2 : 0.250 : 1	|||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.250 : 0.250 : 1	|||||||||||||||||||||||||
+	             1 : 0.500 : 0.750 : 2	||||||||||||||||||||||||||||||||||||||||||||||||||
+	             2 : 0.250 : 1.000 : 1	|||||||||||||||||||||||||
 
 

+ 15 - 15
mainline/tests/general/test_std_code_cs/test_parser_view_files_stdout.gold.txt

@@ -161,14 +161,14 @@
 	Maximum        : 6
 	Total          : 39.0
 	Distribution   : 19 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.316 :  6	||||||||||||||||||||||||||||||||
-	             1 : 0.263 :  5	||||||||||||||||||||||||||
-	             2 : 0.053 :  1	|||||
-	             3 : 0.053 :  1	|||||
-	             4 : 0.105 :  2	|||||||||||
-	             5 : 0.158 :  3	||||||||||||||||
-	             6 : 0.053 :  1	|||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.316 : 0.316 :  6	||||||||||||||||||||||||||||||||
+	             1 : 0.263 : 0.579 :  5	||||||||||||||||||||||||||
+	             2 : 0.053 : 0.632 :  1	|||||
+	             3 : 0.053 : 0.684 :  1	|||||
+	             4 : 0.105 : 0.789 :  2	|||||||||||
+	             5 : 0.158 : 0.947 :  3	||||||||||||||||
+	             6 : 0.053 : 1.000 :  1	|||||
 
 ./Generics.cs:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -274,9 +274,9 @@
 	Maximum        : 1
 	Total          : 1.0
 	Distribution   : 8 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.875 : 7	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.125 : 1	|||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.875 : 0.875 : 7	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.125 : 1.000 : 1	|||||||||||||
 
 ./interface.cs:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -398,9 +398,9 @@
 	Maximum        : 4
 	Total          : 5.0
 	Distribution   : 12 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.833 : 10	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.083 :  1	||||||||
-	             4 : 0.083 :  1	||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.833 : 0.833 : 10	|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.083 : 0.917 :  1	||||||||
+	             4 : 0.083 : 1.000 :  1	||||||||
 
 

+ 19 - 19
mainline/tests/general/test_std_code_java/test_parser_view_files_stdout.gold.txt

@@ -323,12 +323,12 @@
 	Maximum        : 6
 	Total          : 83.0
 	Distribution   : 43 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.186 :  8	|||||||||||||||||||
-	             1 : 0.326 : 14	|||||||||||||||||||||||||||||||||
-	             2 : 0.209 :  9	|||||||||||||||||||||
-	             3 : 0.163 :  7	||||||||||||||||
-	             6 : 0.116 :  5	||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.186 : 0.186 :  8	|||||||||||||||||||
+	             1 : 0.326 : 0.512 : 14	|||||||||||||||||||||||||||||||||
+	             2 : 0.209 : 0.721 :  9	|||||||||||||||||||||
+	             3 : 0.163 : 0.884 :  7	||||||||||||||||
+	             6 : 0.116 : 1.000 :  5	||||||||||||
 
 ./attrs.java:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -355,8 +355,8 @@
 	Maximum        : 0
 	Total          : 0.0
 	Distribution   : 1 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 1.000 : 1.000 : 1	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
 
 ./BinaryHeapPriorityQueue.java:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -690,13 +690,13 @@
 	Maximum        : 6
 	Total          : 37.0
 	Distribution   : 44 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.523 : 23	||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.295 : 13	||||||||||||||||||||||||||||||
-	             2 : 0.114 :  5	|||||||||||
-	             3 : 0.023 :  1	||
-	             5 : 0.023 :  1	||
-	             6 : 0.023 :  1	||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.523 : 0.523 : 23	||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.295 : 0.818 : 13	||||||||||||||||||||||||||||||
+	             2 : 0.114 : 0.932 :  5	|||||||||||
+	             3 : 0.023 : 0.955 :  1	||
+	             5 : 0.023 : 0.977 :  1	||
+	             6 : 0.023 : 1.000 :  1	||
 
 ./Generics.java:0: info: Metrics per '__global__' region
 	Region name    : __global__
@@ -939,9 +939,9 @@
 	Maximum        : 2
 	Total          : 6.0
 	Distribution   : 31 files/regions measured
-	  Metric value : Ratio : Number of files/regions
-	             0 : 0.839 : 26	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
-	             1 : 0.129 :  4	|||||||||||||
-	             2 : 0.032 :  1	|||
+	  Metric value : Ratio : R-sum : Number of files/regions
+	             0 : 0.839 : 0.839 : 26	||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
+	             1 : 0.129 : 0.968 :  4	|||||||||||||
+	             2 : 0.032 : 1.000 :  1	|||