Commit 96d2ad0d authored by Caleb Rouleau's avatar Caleb Rouleau Committed by Commit Bot

[Benchmarking] Reorder logdog work.

This will make it clearer what the root cause of an error is.

Bug: 1035590
Change-Id: I760ace1c4b420c3b751915528f7ff049f5af0571
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1974677
Commit-Queue: Caleb Rouleau <crouleau@chromium.org>
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Auto-Submit: Caleb Rouleau <crouleau@chromium.org>
Reviewed-by: default avatarBrian Sheedy <bsheedy@chromium.org>
Cr-Commit-Position: refs/heads/master@{#726197}
parent c585ec35
...@@ -568,17 +568,20 @@ def _write_perf_data_to_logfile(benchmark_name, output_file, ...@@ -568,17 +568,20 @@ def _write_perf_data_to_logfile(benchmark_name, output_file,
viewer_url = None viewer_url = None
# logdog file to write perf results to # logdog file to write perf results to
if os.path.exists(output_file): if os.path.exists(output_file):
output_json_file = logdog_helper.open_text(benchmark_name)
with open(output_file) as f: with open(output_file) as f:
try: try:
results = json.load(f) results = json.load(f)
json.dump(results, output_json_file,
indent=4, separators=(',', ': '))
except ValueError: except ValueError:
print('Error parsing perf results JSON for benchmark %s' % print('Error parsing perf results JSON for benchmark %s' %
benchmark_name) benchmark_name)
try:
output_json_file.close() output_json_file = logdog_helper.open_text(benchmark_name)
json.dump(results, output_json_file,
indent=4, separators=(',', ': '))
except ValueError as e:
print('ValueError: "%s" while dumping output to logdog' % e)
finally:
output_json_file.close()
viewer_url = output_json_file.get_viewer_url() viewer_url = output_json_file.get_viewer_url()
else: else:
print("Perf results JSON file doesn't exist for benchmark %s" % print("Perf results JSON file doesn't exist for benchmark %s" %
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment