Hash :
2b1bc4fd
Author :
Date :
2023-01-09T12:17:17
Upload angle metrics to the gs bucket in skia perf format.
ConvertToSkiaPerf converts the data format from angle_metrics.json
to what skia perf ingests. Injestion happens automatically when the
gs bucket is updated.
Example data from this CL on non-perf bots with upload enabled
(smoke mode so actual values aren't meaningful):
https://angle-perf.skia.org/e/?queries=buildername%3Dlinux-test%26metric%3Dwall_time%26test%3Dtrex_200
Bug: angleproject:7299
Change-Id: Ica700b586e08c205968fbc3c1d15cf742ad537f4
Reviewed-on: https://chromium-review.googlesource.com/c/angle/angle/+/4148167
Commit-Queue: Roman Lavrov <romanl@google.com>
Reviewed-by: Jamie Madill <jmadill@chromium.org>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
# Copyright 2023 The ANGLE Project Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
#
# Utility for handling ANGLE perf metrics, separate file as it's
# called by both the test runner and the post-processing script.
import collections
import json
import logging
import statistics
def ConvertToSkiaPerf(angle_metrics_json_files):
grouped_results = collections.defaultdict(list)
for fn in angle_metrics_json_files:
with open(fn) as f:
metrics = json.load(f)
for group in metrics:
for d in group:
k = (('suite', d['name']), ('renderer', d['backend'].lstrip('_')),
('test', d['story']), ('metric', d['metric'].lstrip('.')), ('units',
d['units']))
grouped_results[k].append(float(d['value']))
results = []
for k, v in grouped_results.items():
results.append({
'key': dict(k),
'measurements': {
'stat': [{
'value': 'mean',
'measurement': statistics.mean(v),
}, {
'value': 'stdev',
'measurement': statistics.stdev(v) if len(v) > 1 else 0,
}],
},
})
logging.info('angle_metrics to skia perf: %d entries' % len(results))
return results