diff options
author | Craig Tiller <ctiller@google.com> | 2017-04-26 10:38:15 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2017-04-26 10:38:15 -0700 |
commit | ff54f5b15073a16e1270147351aaaefa34112920 (patch) | |
tree | 4546a5f8970fe1af7873df60f1e13c2550f8749b /tools/profiling | |
parent | 46436cbe31bd0bf4603b90046443c23a25295ac9 (diff) | |
parent | e7c31edb555399b699261cb6e0b9f83fb3d6d9d9 (diff) |
Merge github.com:grpc/grpc into trickle_stall
Diffstat (limited to 'tools/profiling')
-rwxr-xr-x | tools/profiling/microbenchmarks/bm_diff.py | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/tools/profiling/microbenchmarks/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff.py index 5f85ef3076..299abb5fdb 100755 --- a/tools/profiling/microbenchmarks/bm_diff.py +++ b/tools/profiling/microbenchmarks/bm_diff.py @@ -208,7 +208,10 @@ def eintr_be_gone(fn): def read_json(filename): - with open(filename) as f: return json.loads(f.read()) + try: + with open(filename) as f: return json.loads(f.read()) + except ValueError, e: + return None def finalize(): @@ -221,16 +224,18 @@ def finalize(): js_old_ctr = read_json('%s.counters.old.%d.json' % (bm, loop)) js_old_opt = read_json('%s.opt.old.%d.json' % (bm, loop)) - for row in bm_json.expand_json(js_new_ctr, js_new_opt): - print row - name = row['cpp_name'] - if name.endswith('_mean') or name.endswith('_stddev'): continue - benchmarks[name].add_sample(row, True) - for row in bm_json.expand_json(js_old_ctr, js_old_opt): - print row - name = row['cpp_name'] - if name.endswith('_mean') or name.endswith('_stddev'): continue - benchmarks[name].add_sample(row, False) + if js_new_ctr: + for row in bm_json.expand_json(js_new_ctr, js_new_opt): + print row + name = row['cpp_name'] + if name.endswith('_mean') or name.endswith('_stddev'): continue + benchmarks[name].add_sample(row, True) + if js_old_ctr: + for row in bm_json.expand_json(js_old_ctr, js_old_opt): + print row + name = row['cpp_name'] + if name.endswith('_mean') or name.endswith('_stddev'): continue + benchmarks[name].add_sample(row, False) really_interesting = set() for name, bm in benchmarks.items(): @@ -247,8 +252,8 @@ def finalize(): text = 'Performance differences noted:\n' + tabulate.tabulate(rows, headers=headers, floatfmt='+.2f') else: text = 'No significant performance differences' - comment_on_pr.comment_on_pr('```\n%s\n```' % text) print text + comment_on_pr.comment_on_pr('```\n%s\n```' % text) eintr_be_gone(finalize) |