Commit 11d533a2 authored by bsheedy's avatar bsheedy Committed by Commit Bot

Fix sizes script conversion error

Fixes an issue in the sizes script when converting from ChartJSON to
HistogramSet. The data produced by the results collector does not
contain the benchmark_name or format_version keys, which causes the
conversion script to fail.

Bug: 906685

Change-Id: I15258026651499ac2a7640958c7bd2d93a794a35
Reviewed-on: https://chromium-review.googlesource.com/c/1352395
Commit-Queue: Brian Sheedy <bsheedy@chromium.org>
Reviewed-by: default avatarThomas Anderson <thomasanderson@chromium.org>
Cr-Commit-Position: refs/heads/master@{#612511}
parent 41118a8b
...@@ -602,8 +602,15 @@ def main(): ...@@ -602,8 +602,15 @@ def main():
if options.output_dir: if options.output_dir:
histogram_path = os.path.join(options.output_dir, 'perf_results.json') histogram_path = os.path.join(options.output_dir, 'perf_results.json')
# We need to add a bit more data to the results, otherwise the conversion
# fails due to the provided data being malformed.
updated_results = {
'format_version': '1.0',
'benchmark_name': 'sizes',
'charts': results_collector.results,
}
with open(histogram_path, 'w') as f: with open(histogram_path, 'w') as f:
json.dump(results_collector.results, f) json.dump(updated_results, f)
histogram_result = convert_chart_json.ConvertChartJson(histogram_path) histogram_result = convert_chart_json.ConvertChartJson(histogram_path)
if histogram_result.returncode != 0: if histogram_result.returncode != 0:
sys.stderr.write( sys.stderr.write(
......
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