Skip to content

Commit

Permalink
tmp: try the other option
Browse files Browse the repository at this point in the history
Signed-off-by: Ondrej Lichtner <[email protected]>
  • Loading branch information
olichtne committed Oct 18, 2024
1 parent 8e924a8 commit fef6817
Showing 1 changed file with 26 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand All @@ -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

Expand Down

0 comments on commit fef6817

Please sign in to comment.