diff options
author | ncteisen <ncteisen@gmail.com> | 2017-06-01 16:19:49 -0700 |
---|---|---|
committer | ncteisen <ncteisen@gmail.com> | 2017-06-01 21:59:46 -0700 |
commit | 2b96949d3d07f5a3a4c3fb5be7f597da63a28c13 (patch) | |
tree | c33cb88570aedca22ec5567ce11d225fc1648b33 /tools | |
parent | bf1ee7b12f4a3517e00e1e813ceaafa1ce41c6de (diff) |
Yapf fmt
Diffstat (limited to 'tools')
-rwxr-xr-x | tools/profiling/microbenchmarks/bm_diff/bm_diff.py | 18 | ||||
-rwxr-xr-x | tools/profiling/microbenchmarks/bm_diff/bm_main.py | 3 | ||||
-rwxr-xr-x | tools/profiling/microbenchmarks/bm_diff/bm_run.py | 2 |
3 files changed, 15 insertions, 8 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 diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_main.py b/tools/profiling/microbenchmarks/bm_diff/bm_main.py index f7ef700de1..4c6eb8b48c 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_main.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_main.py @@ -133,7 +133,8 @@ def main(args): bm_run.run('new', args.benchmarks, args.jobs, args.loops, args.repetitions) bm_run.run(old, args.benchmarks, args.jobs, args.loops, args.repetitions) - diff, note = bm_diff.diff(args.benchmarks, args.loops, args.track, old, 'new') + diff, note = bm_diff.diff(args.benchmarks, args.loops, args.track, old, + 'new') if diff: text = 'Performance differences noted:\n' + diff else: diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_run.py b/tools/profiling/microbenchmarks/bm_diff/bm_run.py index b9cce3ae5a..e281e9e61c 100755 --- a/tools/profiling/microbenchmarks/bm_diff/bm_run.py +++ b/tools/profiling/microbenchmarks/bm_diff/bm_run.py @@ -107,7 +107,7 @@ def _collect_bm_data(bm, cfg, name, reps, idx, loops): shortname='%s %s %s %s %d/%d' % (bm, line, cfg, name, idx + 1, loops), verbose_success=True, - timeout_seconds=60*10, + timeout_seconds=60 * 10, timeout_retries=3)) return jobs_list |