aboutsummaryrefslogtreecommitdiffhomepage
path: root/tools/profiling
diff options
context:
space:
mode:
authorGravatar ncteisen <ncteisen@gmail.com>2017-06-08 23:19:19 -0700
committerGravatar ncteisen <ncteisen@gmail.com>2017-06-08 23:29:02 -0700
commit6a5e923a81acf22a75c4977930daf2b161018769 (patch)
tree9381736424ff655b527b6948a10d206aa65a4feb /tools/profiling
parentdc1685564991c65f1c177c2363c93441bc35134c (diff)
Only output crashes if they occur
Diffstat (limited to 'tools/profiling')
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff/bm_diff.py11
-rwxr-xr-xtools/profiling/microbenchmarks/bm_diff/bm_main.py6
2 files changed, 12 insertions, 5 deletions
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
index 881e157ccd..b8e803749a 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_diff.py
@@ -185,9 +185,14 @@ 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 = 'Corrupt JSON data (indicates timeout or crash) = %s' % str(
- badjson_files)
- note += '\n\nMissing files (new benchmark) = %s' % str(nonexistant_files)
+ note = None
+ if len(badjson_files):
+ note = 'Corrupt JSON data (indicates timeout or crash) = %s' % str(badjson_files)
+ if len(nonexistant_files):
+ if note:
+ note += '\n\nMissing files (indicates new benchmark) = %s' % str(nonexistant_files)
+ else:
+ note = '\n\nMissing files (indicates new benchmark) = %s' % str(nonexistant_files)
if rows:
return tabulate.tabulate(rows, headers=headers, floatfmt='+.2f'), note
else:
diff --git a/tools/profiling/microbenchmarks/bm_diff/bm_main.py b/tools/profiling/microbenchmarks/bm_diff/bm_main.py
index 0136c6aa57..8a54f198ab 100755
--- a/tools/profiling/microbenchmarks/bm_diff/bm_main.py
+++ b/tools/profiling/microbenchmarks/bm_diff/bm_main.py
@@ -126,8 +126,10 @@ def main(args):
text = 'Performance differences noted:\n' + diff
else:
text = 'No significant performance differences'
- print('%s\n%s' % (note, text))
- comment_on_pr.comment_on_pr('```\n%s\n\n%s\n```' % (note, text))
+ if note:
+ text = note + '\n\n' + text
+ print('%s' % text)
+ comment_on_pr.comment_on_pr('```\n%s\n```' % text)
if __name__ == '__main__':