The NetworkFlowTest now holds a list of client/server proceses so
the TrexFlowMeasurement class needs to be updated accordingly.
This also adds one layer of parallel results in the results generated by
multiple client/server processes. However, at this point this is a
transparent change.
Signed-off-by: Jan Tluka <jtluka(a)redhat.com>
---
.../Perf/Measurements/TRexFlowMeasurement.py | 31 ++++++++++++-------
1 file changed, 20 insertions(+), 11 deletions(-)
diff --git a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
index b7808426..4cc1f09b 100644
--- a/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
+++ b/lnst/RecipeCommon/Perf/Measurements/TRexFlowMeasurement.py
@@ -59,13 +59,15 @@ class TRexFlowMeasurement(BaseFlowMeasurement):
result = None
for test in tests:
- test.server_job.start(bg=True)
+ for server_job in test.server_jobs:
+ server_job.start(bg=True)
#wait for Trex server to start
time.sleep(15)
for test in tests:
- test.client_job.start(bg=True)
+ for client_job in test.client_jobs:
+ client_job.start(bg=True)
self._running_measurements = tests
@@ -73,15 +75,19 @@ class TRexFlowMeasurement(BaseFlowMeasurement):
tests = self._running_measurements
try:
for test in tests:
- client_test = test.client_job.what
- test.client_job.wait(timeout=client_test.runtime_estimate())
+ for client_job in test.client_jobs:
+ client_test = client_job.what
+ client_job.wait(timeout=client_test.runtime_estimate())
- test.server_job.kill(signal.SIGINT)
- test.server_job.wait(5)
+ for server_job in test.server_jobs:
+ server_job.kill(signal.SIGINT)
+ server_job.wait(5)
finally:
for test in tests:
- test.server_job.kill()
- test.client_job.kill()
+ for server_job in test.server_jobs:
+ server_job.kill()
+ for client_job in test.client_jobs:
+ client_job.kill()
self._running_measurements = []
self._finished_measurements = tests
@@ -107,7 +113,7 @@ class TRexFlowMeasurement(BaseFlowMeasurement):
duration=flows[0].duration,
msg_size=flows[0].msg_size))
- test = NetworkFlowTest(flows, server_job, client_job)
+ test = NetworkFlowTest(flows, [server_job], [client_job])
tests.append(test)
return tests
@@ -117,8 +123,11 @@ class TRexFlowMeasurement(BaseFlowMeasurement):
results = []
for test in tests:
for port, flow in enumerate(test.flow):
- flow_results = self._parse_results_by_port(
- test.client_job, port, flow)
+ flow_results = ParallelPerfResult()
+ for client_job in test.client_jobs:
+ job_results = self._parse_results_by_port(
+ client_job, port, flow)
+ flow_results.append(job_results)
results.append(flow_results)
return results
--
2.26.2