diff options
author | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-19 12:04:54 +0000 |
---|---|---|
committer | android-build-team Robot <android-build-team-robot@google.com> | 2021-06-19 12:04:54 +0000 |
commit | 4ac7ca7c4f6d13380afa6b0d52313f0f18765038 (patch) | |
tree | 73936aba47fe1dc71e9cc05af9747036e935608c /android_bench_suite | |
parent | b75f321fc8978b92ce3db6886ccb966768f0c7a8 (diff) | |
parent | 4e4201457e5f51a132101c611c79ccff9f713c8b (diff) | |
download | toolchain-utils-4ac7ca7c4f6d13380afa6b0d52313f0f18765038.tar.gz |
Snap for 7474514 from 4e4201457e5f51a132101c611c79ccff9f713c8b to mainline-media-releaseandroid-mainline-12.0.0_r89android-mainline-12.0.0_r74android-mainline-12.0.0_r62android-mainline-12.0.0_r46android-mainline-12.0.0_r29android-mainline-12.0.0_r12android-mainline-12.0.0_r119android-mainline-12.0.0_r104android12-mainline-media-release
Change-Id: I2fe70a8ca191c683886391da7cc959d8659fac4c
Diffstat (limited to 'android_bench_suite')
-rwxr-xr-x | android_bench_suite/fix_skia_results.py | 21 |
1 files changed, 12 insertions, 9 deletions
diff --git a/android_bench_suite/fix_skia_results.py b/android_bench_suite/fix_skia_results.py index 8c919d35..84dee5a5 100755 --- a/android_bench_suite/fix_skia_results.py +++ b/android_bench_suite/fix_skia_results.py @@ -5,6 +5,7 @@ # found in the LICENSE file. # # pylint: disable=cros-logging-import + """Transforms skia benchmark results to ones that crosperf can understand.""" from __future__ import print_function @@ -57,7 +58,10 @@ def _GetTimeMultiplier(label_name): def _GetTimeDenom(ms): - """Given a list of times (in milliseconds), find a sane time unit for them. + """Express times in a common time unit. + + Given a list of times (in milliseconds), find a time unit in which + they can all be expressed. Returns the unit name, and `ms` normalized to that time unit. @@ -94,9 +98,9 @@ def _TransformBenchmarks(raw_benchmarks): # statistic... benchmarks = raw_benchmarks['results'] results = [] - for bench_name, bench_result in benchmarks.iteritems(): + for bench_name, bench_result in benchmarks.items(): try: - for cfg_name, keyvals in bench_result.iteritems(): + for cfg_name, keyvals in bench_result.items(): # Some benchmarks won't have timing data (either it won't exist at all, # or it'll be empty); skip them. samples = keyvals.get('samples') @@ -109,17 +113,16 @@ def _TransformBenchmarks(raw_benchmarks): friendly_name = _GetFamiliarName(bench_name) if len(results) < len(samples): - results.extend({ - 'retval': 0 - } for _ in range(len(samples) - len(results))) + results.extend( + {'retval': 0} for _ in range(len(samples) - len(results))) time_mul = _GetTimeMultiplier(friendly_name) - for sample, app in itertools.izip(samples, results): + for sample, app in itertools.zip(samples, results): assert friendly_name not in app app[friendly_name] = sample * time_mul except (KeyError, ValueError) as e: - logging.error('While converting "%s" (key: %s): %s', - bench_result, bench_name, e.message) + logging.error('While converting "%s" (key: %s): %s', bench_result, + bench_name, e) raise # Realistically, [results] should be multiple results, where each entry in the |