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.py17
1 files changed, 7 insertions, 10 deletions
diff --git a/scripts/lib/build_perf/report.py b/scripts/lib/build_perf/report.py
index d99a36797f..f4e6a92e09 100644
--- a/scripts/lib/build_perf/report.py
+++ b/scripts/lib/build_perf/report.py
@@ -1,17 +1,11 @@
#
# Copyright (c) 2017, Intel Corporation.
#
-# This program is free software; you can redistribute it and/or modify it
-# under the terms and conditions of the GNU General Public License,
-# version 2, as published by the Free Software Foundation.
-#
-# This program is distributed in the hope it will be useful, but WITHOUT
-# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
-# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
-# more details.
+# 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
@@ -300,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,
@@ -325,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))
@@ -340,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