diff --git a/lnst/RecipeCommon/Perf/Measurements/Results/FlowMeasurementResults.py b/lnst/RecipeCommon/Perf/Measurements/Results/FlowMeasurementResults.py index bda9caa09..665372c35 100644 --- a/lnst/RecipeCommon/Perf/Measurements/Results/FlowMeasurementResults.py +++ b/lnst/RecipeCommon/Perf/Measurements/Results/FlowMeasurementResults.py @@ -6,9 +6,7 @@ class FlowMeasurementResults(BaseMeasurementResults): def __init__(self, measurement, flow, warmup_duration=0): - super(FlowMeasurementResults, self).__init__( - measurement, warmup_duration - ) + super(FlowMeasurementResults, self).__init__(measurement, warmup_duration) self._flow = flow self._generator_results = None self._generator_cpu_stats = None @@ -84,11 +82,31 @@ def end_timestamp(self): @property def warmup_end(self): - return self.start_timestamp+self.warmup_duration + return ( + max( + [ + self.generator_results.start_timestamp, + self.generator_cpu_stats.start_timestamp, + self.receiver_results.start_timestamp, + self.receiver_cpu_stats.start_timestamp, + ] + ) + + self.warmup_duration + ) @property def warmdown_start(self): - return self.end_timestamp-self.warmup_duration + return ( + min( + [ + self.generator_results.end_timestamp, + self.generator_cpu_stats.end_timestamp, + self.receiver_results.end_timestamp, + self.receiver_cpu_stats.end_timestamp, + ] + ) + - self.warmup_duration + ) def time_slice(self, start, end): result_copy = FlowMeasurementResults( @@ -98,16 +116,10 @@ def time_slice(self, start, end): result_copy.generator_cpu_stats = self.generator_cpu_stats.time_slice( start, end ) - result_copy.receiver_cpu_stats = self.receiver_cpu_stats.time_slice( - start, end - ) + result_copy.receiver_cpu_stats = self.receiver_cpu_stats.time_slice(start, end) - result_copy.generator_results = self.generator_results.time_slice( - start, end - ) - result_copy.receiver_results = self.receiver_results.time_slice( - start, end - ) + result_copy.generator_results = self.generator_results.time_slice(start, end) + result_copy.receiver_results = self.receiver_results.time_slice(start, end) return result_copy