X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=resources%2Ftools%2Ftrex%2Ftrex_stateless_profile.py;h=9323d8a859b8264b929c088a6b8622c945140714;hb=974876b90a5a438d8c7f476c63e82547e59adbdc;hp=9233f6a5f159717666c48c9f6858a13f5d6fd5b3;hpb=d68951ac245150eeefa6e0f4156e4c1b5c9e9325;p=csit.git diff --git a/resources/tools/trex/trex_stateless_profile.py b/resources/tools/trex/trex_stateless_profile.py index 9233f6a5f1..9323d8a859 100755 --- a/resources/tools/trex/trex_stateless_profile.py +++ b/resources/tools/trex/trex_stateless_profile.py @@ -21,9 +21,10 @@ latency. import argparse import json import sys +import time sys.path.insert( - 0, "/opt/trex-core-2.61/scripts/automation/trex_control_plane/interactive/" + 0, u"/opt/trex-core-2.73/scripts/automation/trex_control_plane/interactive/" ) from trex.stl.api import * @@ -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():