The start_timestamp and end_timestamp properties are added that return the
maximal timestamp of the first samples and minimal timestamp of the last samples
respectively from the generator flow data.
These timestamps will be used to align a collection of related measurements.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
.../RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
index 856eeba3..bbf19a2e 100644
--- a/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/BaseFlowMeasurement.py
@@ -162,6 +162,14 @@ class FlowMeasurementResults(BaseMeasurementResults):
def receiver_cpu_stats(self, value):
self._receiver_cpu_stats = value
+ @property
+ def start_timestamp(self):
+ return max([seq_result[0].timestamp for seq_result in self.generator_results])
+
+ @property
+ def end_timestamp(self):
+ return min([seq_result[-1].timestamp for seq_result in self.generator_results])
+
class AggregatedFlowMeasurementResults(FlowMeasurementResults):
def __init__(self, measurement, flow):
super(FlowMeasurementResults, self).__init__(measurement)
--
2.26.2