summaryrefslogtreecommitdiffstats
path: root/scripts/lib/build_perf/report.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/lib/build_perf/report.py')
-rw-r--r--scripts/lib/build_perf/report.py8
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 @@
4# SPDX-License-Identifier: GPL-2.0-only 4# SPDX-License-Identifier: GPL-2.0-only
5# 5#
6"""Handling of build perf test reports""" 6"""Handling of build perf test reports"""
7from collections import OrderedDict, Mapping, namedtuple 7from collections import OrderedDict, namedtuple
8from collections.abc import Mapping
8from datetime import datetime, timezone 9from datetime import datetime, timezone
9from numbers import Number 10from numbers import Number
10from statistics import mean, stdev, variance 11from statistics import mean, stdev, variance
@@ -293,7 +294,7 @@ class SizeVal(MeasurementVal):
293 return "null" 294 return "null"
294 return self / 1024 295 return self / 1024
295 296
296def measurement_stats(meas, prefix=''): 297def measurement_stats(meas, prefix='', time=0):
297 """Get statistics of a measurement""" 298 """Get statistics of a measurement"""
298 if not meas: 299 if not meas:
299 return {prefix + 'sample_cnt': 0, 300 return {prefix + 'sample_cnt': 0,
@@ -318,6 +319,8 @@ def measurement_stats(meas, prefix=''):
318 stats['quantity'] = val_cls.quantity 319 stats['quantity'] = val_cls.quantity
319 stats[prefix + 'sample_cnt'] = len(values) 320 stats[prefix + 'sample_cnt'] = len(values)
320 321
322 # Add start time for both type sysres and disk usage
323 start_time = time
321 mean_val = val_cls(mean(values)) 324 mean_val = val_cls(mean(values))
322 min_val = val_cls(min(values)) 325 min_val = val_cls(min(values))
323 max_val = val_cls(max(values)) 326 max_val = val_cls(max(values))
@@ -333,6 +336,7 @@ def measurement_stats(meas, prefix=''):
333 stats[prefix + 'max'] = max_val 336 stats[prefix + 'max'] = max_val
334 stats[prefix + 'minus'] = val_cls(mean_val - min_val) 337 stats[prefix + 'minus'] = val_cls(mean_val - min_val)
335 stats[prefix + 'plus'] = val_cls(max_val - mean_val) 338 stats[prefix + 'plus'] = val_cls(max_val - mean_val)
339 stats[prefix + 'start_time'] = start_time
336 340
337 return stats 341 return stats
338 342