diff options
Diffstat (limited to 'scripts/lib/build_perf/report.py')
-rw-r--r-- | scripts/lib/build_perf/report.py | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/scripts/lib/build_perf/report.py b/scripts/lib/build_perf/report.py index 4e8e2a8a93..f4e6a92e09 100644 --- a/scripts/lib/build_perf/report.py +++ b/scripts/lib/build_perf/report.py @@ -4,7 +4,8 @@ # SPDX-License-Identifier: GPL-2.0-only # """Handling of build perf test reports""" -from collections import OrderedDict, Mapping, namedtuple +from collections import OrderedDict, namedtuple +from collections.abc import Mapping from datetime import datetime, timezone from numbers import Number from statistics import mean, stdev, variance @@ -293,7 +294,7 @@ class SizeVal(MeasurementVal): return "null" return self / 1024 -def measurement_stats(meas, prefix=''): +def measurement_stats(meas, prefix='', time=0): """Get statistics of a measurement""" if not meas: return {prefix + 'sample_cnt': 0, @@ -318,6 +319,8 @@ def measurement_stats(meas, prefix=''): stats['quantity'] = val_cls.quantity stats[prefix + 'sample_cnt'] = len(values) + # Add start time for both type sysres and disk usage + start_time = time mean_val = val_cls(mean(values)) min_val = val_cls(min(values)) max_val = val_cls(max(values)) @@ -333,6 +336,7 @@ def measurement_stats(meas, prefix=''): stats[prefix + 'max'] = max_val stats[prefix + 'minus'] = val_cls(mean_val - min_val) stats[prefix + 'plus'] = val_cls(max_val - mean_val) + stats[prefix + 'start_time'] = start_time return stats |