diff options
author | 2017-01-22 16:20:45 +0200 | |
---|---|---|
committer | 2017-01-22 16:20:45 +0200 | |
commit | 904eacd9be1230efb7ae0ab7997ec131b588ec8a (patch) | |
tree | 8e4bcd1b1a5f683efdb8f3eeb962acefc3201961 /scripts/automation/trex_control_plane/stf | |
parent | d2f1c8451e2e8ffc47b208f68f9b16697d706d60 (diff) | |
parent | b81cdb6c2d6d118c1c346e7c8dae6a5e747d867d (diff) |
Merge branch 'master' into capture
Signed-off-by: imarom <imarom@cisco.com>
Conflicts:
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_client.py
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_jsonrpc_client.py
scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_port.py
src/main_dpdk.cpp
Diffstat (limited to 'scripts/automation/trex_control_plane/stf')
-rw-r--r-- | scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py | 7 | ||||
-rwxr-xr-x | scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py | 54 |
2 files changed, 56 insertions, 5 deletions
diff --git a/scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py b/scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py index 0a72c9ac..8560a5db 100644 --- a/scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py +++ b/scripts/automation/trex_control_plane/stf/examples/stf_active_flow.py @@ -14,8 +14,8 @@ def minimal_stateful_test(server,csv_file,a_active_flows): trex_client.start_trex( c = 7, m = 30000, -# f = 'cap2/cur_flow_single.yaml', - f = 'cap2/cur_flow.yaml', + f = 'cap2/cur_flow_single.yaml', +# f = 'cap2/cur_flow.yaml', d = 30, l = 1000, p=True, @@ -39,6 +39,7 @@ def minimal_stateful_test(server,csv_file,a_active_flows): print("WARNING QUEU WAS FULL"); tuple=(active_flows[-5],cpu_utl[-5],pps[-5],queue_full[-1]) + print(tuple) file_writer = csv.writer(test_file) file_writer.writerow(tuple); @@ -58,7 +59,7 @@ if __name__ == '__main__': max_flows = 8000000; min_flows = 100; active_flow = min_flows; - num_point = 10 + num_point = 40 factor = math.exp(math.log(max_flows/min_flows,math.e)/num_point); for i in range(num_point+1): print("<<=====================>>",i,math.floor(active_flow)) 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: |