diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-08-07 21:21:45 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-08-07 21:21:45 +0300 |
commit | 3d1bfe7ee02881c8beb72a79349aeb22fca48282 (patch) | |
tree | 2c32aeb94f1e2e9f5944d432abb38e9b6c5a213c | |
parent | 10d8dad6941b1aaa952b86a4a88cc6c67057ee14 (diff) | |
download | obnam-benchmarks-3d1bfe7ee02881c8beb72a79349aeb22fca48282.tar.gz |
Report percentage of reference
-rwxr-xr-x | obbench | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -233,7 +233,7 @@ class ObnamBenchmarker(cliapp.Application): for step in obj['steps']: if 'obnam' in step: f.write( - '<th>{action} (ref)</th>\n'.format( + '<th>{action} (% of ref)</th>\n'.format( action=self.q(step['obnam']))) f.write('</tr>\n') @@ -255,7 +255,8 @@ class ObnamBenchmarker(cliapp.Application): if benchmark is not None: spec_step = benchmark['steps'][index] if 'reference' in spec_step: - reference = '%.0f' % spec_step['reference'] + reference = '%.1f %%' % ( + 100.0 * step['duration'] / spec_step['reference']) f.write( '<td><a href="{link}">{duration}</a> ' @@ -301,7 +302,7 @@ class ObnamBenchmarker(cliapp.Application): f.write('<th>commit</th>\n') f.write('<th>commit msg</th>\n') for name in benchmark_names: - f.write('<th>{name} (ref)</th>\n'.format(name=self.q(name))) + f.write('<th>{name} (% of ref)</th>\n'.format(name=self.q(name))) f.write('</tr>\n') for run in runs: @@ -325,6 +326,11 @@ class ObnamBenchmarker(cliapp.Application): sum(x.get('reference', 0) for x in b['steps']) for b in spec['benchmarks'] if b['name'] == name) + if reference > 0: + reference = '%.1f %%' % ( + 100.0 * run['durations'][name]) + else: + reference = 'unknown' f.write( '<td class="duration">' |