diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-08-07 20:44:47 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-08-07 20:44:47 +0300 |
commit | d8a0b4a25f0e8832a255152c7dd777d8082e4517 (patch) | |
tree | 9ecd902606834e7e27d6cc8892625f5cd703f552 /obbench | |
parent | 9f3312a79f0782ef666f278de8cf36715658505f (diff) | |
download | obnam-benchmarks-d8a0b4a25f0e8832a255152c7dd777d8082e4517.tar.gz |
Handle missing reference field
Diffstat (limited to 'obbench')
-rwxr-xr-x | obbench | 4 |
1 files changed, 2 insertions, 2 deletions
@@ -249,7 +249,7 @@ class ObnamBenchmarker(cliapp.Application): '({ref})</td>\n'.format( link=self.q(basename), duration=self.q('%.1f' % step['duration']), - ref=step['reference'])) + ref=step.get('reference', 0))) f.write('</tr>\n') f.write('</table>\n') @@ -338,7 +338,7 @@ class ObnamBenchmarker(cliapp.Application): return (obj['date'], obj['commit_id']) def total(obj, field): - return sum(step[field] for step in obj['steps']) + return sum(step.get(field, 0) for step in obj['steps']) sorted_objs = [] for obj in objs: |