From 624b26f93ccb6d593f94b7147e50b363839336d0 Mon Sep 17 00:00:00 2001 From: Lars Wirzenius Date: Fri, 7 Aug 2015 20:52:44 +0300 Subject: Use reference times from spec, not result --- obbench | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) (limited to 'obbench') diff --git a/obbench b/obbench index 157c1f5..f7caa25 100755 --- a/obbench +++ b/obbench @@ -202,8 +202,6 @@ class ObnamBenchmarker(cliapp.Application): return objs def write_benchmark_page(self, spec, obj): - steps = [s for s in obj['steps'] if 'obnam' in s] - filename = os.path.join( spec['html_dir'], '{}_{}.html'.format(obj['commit_id'], obj['name'])) @@ -227,14 +225,18 @@ class ObnamBenchmarker(cliapp.Application): f.write('\n') f.write('\n') - for step in steps: - f.write( - '\n'.format( - action=self.q(step['obnam']))) + for step in objs['steps']: + if 'obnam' in step: + f.write( + '\n'.format( + action=self.q(step['obnam']))) f.write('\n') f.write('\n') - for index, step in enumerate(steps): + for index, step in enumerate(objs['steps']): + if 'obnam' not in step: + continue + basename = '{commit}_{name}_{index}.txt'.format( commit=obj['commit_id'], name=obj['name'], @@ -244,12 +246,13 @@ class ObnamBenchmarker(cliapp.Application): with open(profile_filename, 'w') as profile: profile.write(step['profile']) + spec_step = spec['steps'][index] f.write( '\n'.format( link=self.q(basename), duration=self.q('%.1f' % step['duration']), - ref=step.get('reference', 0))) + ref=spec_step.get('reference', 0))) f.write('\n') f.write('
{action} (ref){action} (ref)
{duration} ' '({ref})
\n') -- cgit v1.2.1