66 data = JSONDict(
67 FLAGS.properties + \
68 ['key', JSONDict(FLAGS.key + \
69 ['bench_type', 'playback', \
70 'source_type', 'skp'])])
71
72 for src in FLAGS.sources:
73 with open(src, mode='r') as infile:
74 for line in infile:
75 match = BenchResult.match(line)
76 if not match:
77 continue
78 if match.sample_ms != 50:
79 raise Exception("%s: unexpected sample_ms != 50" % match.sample_ms)
80 for result in ('accum', 'median', 'min', 'max'):
81 data['results'][match.bench][match.config] \
82 ['%s_%s_%s' % (result, match.clock, match.metric)] = \
83 getattr(match, result)
84
85 if FLAGS.outfile != '-':
86 with open(FLAGS.outfile, 'w+') as outfile:
87 data.emit(outfile)
88 else:
89 data.emit(sys.stdout)
90