Perf tests: write metrics to file and read from merge script.

The idea behind is to save metrics in a structured output with
full context so that we don't have to parse stdout and
reconstruct that context (e.g. which test was running when
the output was printed etc).

Note: we already have a "histogram" file (addHistogramSample)
written but it is structured using some UUID-based ids making its
digestion more complicated (https://anglebug.com/7299#c3).
This CL just writes events as one-json-per-line
simplifying downstream handling and debugging.

Just a sanity check / logging in the merge script for now.

Bug: angleproject:7299
Change-Id: I56dada643eceef180ce9bb1aa9ae6a641ea41e4c
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/3945112
Reviewed-by: Jamie Madill <jmadill@chromium.org>
Commit-Queue: Roman Lavrov <romanl@google.com>
This commit is contained in:
Roman Lavrov
2022-10-11 11:58:20 -04:00
committed by Angle LUCI CQ
parent 91ff986cc9
commit 056f80448f
6 changed files with 187 additions and 47 deletions

View File

@@ -293,6 +293,17 @@ def process_perf_results(output_json,
benchmark_enabled_map = _handle_perf_json_test_results(benchmark_directory_map,
test_results_list)
for benchmark_name, directories in benchmark_directory_map.items():
if not benchmark_enabled_map.get(benchmark_name, False):
continue
for directory in directories:
with open(os.path.join(directory, 'angle_metrics.json')) as f:
metrics = json.load(f)
metric_names = list(set(d['metric'] for d in group for group in metrics))
logging.info('angle_metrics: len=%d metrics=%s (directory=%s)' %
(len(metrics), '|'.join(metric_names), directory))
if not smoke_test_mode and handle_perf:
build_properties_map = json.loads(build_properties)
if not configuration_name: