aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
diff options
context:
space:
mode:
Diffstat (limited to 'tools/profiling/microbenchmarks/bm_diff/bm_diff.py')
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff/bm_diff.py18
1 files changed, 12 insertions, 6 deletions
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
index 82b39874dd..b049f41ca0 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
@@ -129,6 +129,7 @@ class Benchmark:
def row(self, flds):
return [self.final[f] if f in self.final else '' for f in flds]
+
def _read_json(filename, badfiles):
stripped = ".".join(filename.split(".")[:-2])
try:
@@ -154,13 +155,17 @@ def diff(bms, loops, track, old, new):
stripped_line = line.strip().replace("/", "_").replace(
"<", "_").replace(">", "_").replace(", ", "_")
js_new_ctr = _read_json('%s.%s.counters.%s.%d.json' %
- (bm, stripped_line, new, loop), badfiles)
+ (bm, stripped_line, new, loop),
+ badfiles)
js_new_opt = _read_json('%s.%s.opt.%s.%d.json' %
- (bm, stripped_line, new, loop), badfiles)
+ (bm, stripped_line, new, loop),
+ badfiles)
js_old_ctr = _read_json('%s.%s.counters.%s.%d.json' %
- (bm, stripped_line, old, loop), badfiles)
+ (bm, stripped_line, old, loop),
+ badfiles)
js_old_opt = _read_json('%s.%s.opt.%s.%d.json' %
- (bm, stripped_line, old, loop), badfiles)
+ (bm, stripped_line, old, loop),
+ badfiles)
if js_new_ctr:
for row in bm_json.expand_json(js_new_ctr, js_new_opt):
@@ -186,7 +191,7 @@ def diff(bms, loops, track, old, new):
for name in sorted(benchmarks.keys()):
if benchmarks[name].skip(): continue
rows.append([name] + benchmarks[name].row(fields))
- note += 'flakiness data = %s' % str(badfiles)
+ note = 'flakiness data = %s' % str(badfiles)
if rows:
return tabulate.tabulate(rows, headers=headers, floatfmt='+.2f'), note
else:
@@ -195,7 +200,8 @@ def diff(bms, loops, track, old, new):
if __name__ == '__main__':
args = _args()
- diff, note = diff(args.benchmarks, args.loops, args.track, args.old, args.new)
+ diff, note = diff(args.benchmarks, args.loops, args.track, args.old,
+ args.new)
print note
print ""
print diff