]> code.ossystems Code Review - openembedded-core.git/commitdiff
scripts/buildstats-diff: add walltime to --diff-attr
authorMarkus Lehtonen <markus.lehtonen@linux.intel.com>
Thu, 29 Sep 2016 14:28:05 +0000 (17:28 +0300)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Fri, 30 Sep 2016 16:14:11 +0000 (17:14 +0100)
For comparing the elapsed wall clock time of tests. Default values for
--min-val and --min-absdiff are 5 seconds and 2 seconds.

Signed-off-by: Markus Lehtonen <markus.lehtonen@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
scripts/buildstats-diff

index c6fa803445f2865fe9eb03c03d1289caca2106e3..f26a6c139eef8773a180a62ad6d767d3faa342ee 100755 (executable)
@@ -78,6 +78,11 @@ class BSTask(dict):
         return self['rusage']['ru_stime'] + self['rusage']['ru_utime'] + \
                self['child_rusage']['ru_stime'] + self['child_rusage']['ru_utime']
 
+    @property
+    def walltime(self):
+        """Elapsed wall clock time"""
+        return self['elapsed_time'].total_seconds()
+
     @property
     def read_bytes(self):
         """Bytes read from the block layer"""
@@ -306,7 +311,7 @@ def print_task_diff(bs1, bs2, val_type, min_val=0, min_absdiff=0, sort_by=('absd
             else:
                 return "{:d}:{:02d}:{:04.1f}".format(h, m, s)
 
-        if val_type == 'cputime':
+        if 'time' in val_type:
             if human_readable:
                 return hms_time(val)
             else:
@@ -437,12 +442,14 @@ Script for comparing buildstats of two separate builds."""
                         'read_bytes': 524288,
                         'write_bytes': 524288,
                         'read_ops': 500,
-                        'write_ops': 500}
+                        'write_ops': 500,
+                        'walltime': 5}
     min_absdiff_defaults = {'cputime': 1.0,
                             'read_bytes': 131072,
                             'write_bytes': 131072,
                             'read_ops': 50,
-                            'write_ops': 50}
+                            'write_ops': 50,
+                            'walltime': 2}
 
     parser.add_argument('--debug', '-d', action='store_true',
                         help="Verbose logging")