summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py')
-rwxr-xr-xscripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py54
1 files changed, 52 insertions, 2 deletions
diff --git a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
index 0977d2eb..4e7deb93 100755
--- a/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
+++ b/scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py
@@ -154,8 +154,7 @@ class CTRexClient(object):
raise ValueError('d parameter must be integer, specifying how long TRex run.')
trex_cmd_options.update( {'f' : f, 'd' : d} )
- if not trex_cmd_options.get('l'):
- self.result_obj.latency_checked = False
+ self.result_obj.latency_checked = 'l' in trex_cmd_options
if 'k' in trex_cmd_options:
timeout += int(trex_cmd_options['k']) # during 'k' seconds TRex stays in 'Starting' state
@@ -1117,6 +1116,7 @@ class CTRexResult(object):
"Done warmup? {arg}\n".format( arg = self.is_done_warmup() ) +
"Expected tx rate: {arg}\n".format( arg = self.get_expected_tx_rate() ) +
"Current tx rate: {arg}\n".format( arg = self.get_current_tx_rate() ) +
+ "Minimum latency: {arg}\n".format( arg = self.get_min_latency() ) +
"Maximum latency: {arg}\n".format( arg = self.get_max_latency() ) +
"Average latency: {arg}\n".format( arg = self.get_avg_latency() ) +
"Average window latency: {arg}\n".format( arg = self.get_avg_window_latency() ) +
@@ -1163,6 +1163,36 @@ class CTRexResult(object):
"""
return self._max_latency
+ def get_min_latency (self):
+ """
+ Fetches the minimum latency measured on each of the interfaces
+
+ :parameters:
+ None
+
+ :return:
+ dictionary containing the maximum latency, where the key is the measurement interface (`c` indicates client), and the value is the measurement value.
+
+ """
+ return self._min_latency
+
+
+
+ def get_jitter_latency (self):
+ """
+ Fetches the jitter latency measured on each of the interfaces from the start of TRex run
+
+ :parameters:
+ None
+
+ :return:
+ dictionary containing the average latency, where the key is the measurement interface (`c` indicates client), and the value is the measurement value.
+
+ The `all` key represents the average of all interfaces' average
+
+ """
+ return self._jitter_latency
+
def get_avg_latency (self):
"""
Fetches the average latency measured on each of the interfaces from the start of TRex run
@@ -1398,8 +1428,11 @@ class CTRexResult(object):
latency_per_port = self.get_last_value("trex-latency-v2.data", "port-")
self._max_latency = self.__get_filtered_max_latency(latency_per_port, self.filtered_latency_amount)
+ self._min_latency = self.__get_filtered_min_latency(latency_per_port)
avg_latency = self.get_last_value("trex-latency.data", "avg-")
self._avg_latency = CTRexResult.__avg_all_and_rename_keys(avg_latency)
+ jitter_latency = self.get_last_value("trex-latency.data", "jitter-")
+ self._jitter_latency = CTRexResult.__avg_all_and_rename_keys(jitter_latency)
avg_win_latency_list = self.get_value_list("trex-latency.data", "avg-")
self._avg_window_latency = CTRexResult.__calc_latency_win_stats(avg_win_latency_list)
@@ -1425,7 +1458,9 @@ class CTRexResult(object):
self._expected_tx_rate = None
self._current_tx_rate = None
self._max_latency = None
+ self._min_latency = None
self._avg_latency = None
+ self._jitter_latency = None
self._avg_window_latency = None
self._total_drops = None
self._drop_rate = None
@@ -1488,6 +1523,21 @@ class CTRexResult(object):
return res
@staticmethod
+ def __get_filtered_min_latency(src_dict):
+ result = {}
+ if src_dict:
+ for port, data in src_dict.items():
+ if not port.startswith('port-'):
+ continue
+ res = data['hist']['min_usec']
+ min_port = 'min-%s' % port[5:]
+ result[min_port] = int(res)
+
+ return(result);
+
+
+
+ @staticmethod
def __get_filtered_max_latency (src_dict, filtered_latency_amount = 0.001):
result = {}
if src_dict: