summaryrefslogtreecommitdiff
path: root/obbench
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-08-07 20:44:47 +0300
committerLars Wirzenius <liw@liw.fi>2015-08-07 20:44:47 +0300
commitd8a0b4a25f0e8832a255152c7dd777d8082e4517 (patch)
tree9ecd902606834e7e27d6cc8892625f5cd703f552 /obbench
parent9f3312a79f0782ef666f278de8cf36715658505f (diff)
downloadobnam-benchmarks-d8a0b4a25f0e8832a255152c7dd777d8082e4517.tar.gz
Handle missing reference field
Diffstat (limited to 'obbench')
-rwxr-xr-xobbench4
1 files changed, 2 insertions, 2 deletions
diff --git a/obbench b/obbench
index 97fd071..157c1f5 100755
--- a/obbench
+++ b/obbench
@@ -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: