aboutsummaryrefslogtreecommitdiffstats
path: root/resources
diff options
context:
space:
mode:
authorVratko Polak <vrpolak@cisco.com>2020-01-08 15:08:14 +0100
committerVratko Polak <vrpolak@cisco.com>2020-01-08 15:08:14 +0100
commit919fdbd0f6ee7f312b80813c53866c2a4213a818 (patch)
treec95c7c24fc8ac7a9c8d893fc181e4c6edafa01ac /resources
parent45b4d9166c38767d18f4b73403927a2c5494cc6a (diff)
Track real(er) duration of traffic
+ Print duration. - Missing: Parse duration. - We do not have good formula to compensate, yet. Change-Id: I1c76ac35ce531b1994480d6aa0638f16992231f5 Signed-off-by: Vratko Polak <vrpolak@cisco.com>
Diffstat (limited to 'resources')
-rwxr-xr-xresources/tools/trex/trex_stateless_profile.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/resources/tools/trex/trex_stateless_profile.py b/resources/tools/trex/trex_stateless_profile.py
index 90a4cf0bec..9323d8a859 100755
--- a/resources/tools/trex/trex_stateless_profile.py
+++ b/resources/tools/trex/trex_stateless_profile.py
@@ -21,6 +21,7 @@ latency.
import argparse
import json
import sys
+import time
sys.path.insert(
0, u"/opt/trex-core-2.73/scripts/automation/trex_control_plane/interactive/"
@@ -158,10 +159,13 @@ def simple_burst(
client.clear_stats()
# Choose rate and start traffic:
+ time_start = time.time()
client.start(ports=ports, mult=rate, duration=warmup_time)
# Block until done:
client.wait_on_traffic(ports=ports, timeout=warmup_time+30)
+ time_stop = time.time()
+ print(f"Warmup traffic took {time_stop - time_start} seconds.")
if client.get_warnings():
for warning in client.get_warnings():
@@ -187,6 +191,7 @@ def simple_burst(
lost_b = 0
# Choose rate and start traffic:
+ time_start = time.time()
client.start(ports=ports, mult=rate, duration=duration)
if async_start:
@@ -199,6 +204,8 @@ def simple_burst(
else:
# Block until done:
client.wait_on_traffic(ports=ports, timeout=duration+30)
+ time_stop = time.time()
+ print(f"Main traffic took {time_stop - time_start} seconds.")
if client.get_warnings():
for warning in client.get_warnings():