From 9f3312a79f0782ef666f278de8cf36715658505f Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 7 Aug 2015 20:42:02 +0300 Subject: Display references in summary table --- obbench | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'obbench') diff --git a/obbench b/obbench index b53053e..97fd071 100755 --- a/obbench +++ b/obbench @@ -288,7 +288,7 @@ class ObnamBenchmarker(cliapp.Application): f.write('commit\n') f.write('commit msg\n') for name in benchmark_names: - f.write('{name}\n'.format(name=self.q(name))) + f.write('{name} (ref)\n'.format(name=self.q(name))) f.write('\n') for run in runs: @@ -307,11 +307,14 @@ class ObnamBenchmarker(cliapp.Application): commit=self.q(run['commit_id']), name=self.q(name)) duration = '%.1f' % run['durations'][name] + reference = '%.0f' % run['references'][name] f.write( '' - '{duration}\n'.format( + '{duration} ' + '({reference})\n'.format( link=link, - duration=self.q(duration))) + duration=self.q(duration), + reference=reference)) f.write('\n') f.write('\n') @@ -334,8 +337,8 @@ class ObnamBenchmarker(cliapp.Application): def make_key(obj): return (obj['date'], obj['commit_id']) - def total(obj): - return sum(step['duration'] for step in obj['steps']) + def total(obj, field): + return sum(step[field] for step in obj['steps']) sorted_objs = [] for obj in objs: @@ -349,10 +352,12 @@ class ObnamBenchmarker(cliapp.Application): 'date': obj['date'], 'commit_id': obj['commit_id'], 'commit_msg': obj['commit_msg'], - 'durations': { obj['name']: total(obj) } + 'durations': { obj['name']: total(obj, 'duration') }, + 'references': { obj['name']: total(obj, 'reference') }, }) else: - runs[-1]['durations'][obj['name']] = total(obj) + runs[-1]['durations'][obj['name']] = total(obj, 'duration') + runs[-1]['references'][obj['name']] = total(obj, 'reference') return runs -- cgit v1.2.1