The start_timestamp and end_timestamp properties are added that return the
timestamp of the first sample and the last sample respectively from the cpu
stat data.
These timestamps will be used to align a collection of related measurements.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
lnst/RecipeCommon/Perf/Measurements/StatCPUMeasurement.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lnst/RecipeCommon/Perf/Measurements/StatCPUMeasurement.py
b/lnst/RecipeCommon/Perf/Measurements/StatCPUMeasurement.py
index a8e3b618..3abcf7d0 100644
--- a/lnst/RecipeCommon/Perf/Measurements/StatCPUMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/StatCPUMeasurement.py
@@ -26,6 +26,14 @@ class StatCPUMeasurementResults(CPUMeasurementResults):
self._data["system"], self._data["irq"],
self._data["softirq"],
self._data["steal"]])
+ @property
+ def start_timestamp(self):
+ return self._data["user"][0].timestamp
+
+ @property
+ def end_timestamp(self):
+ return self._data["user"][-1].timestamp
+
class StatCPUMeasurement(BaseCPUMeasurement):
def __init__(self, *args):
super(StatCPUMeasurement, self).__init__(*args)
--
2.26.2