From 9eda18ac948dc35996baf81940683bd5baea9858 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Tue, 3 Jan 2017 17:25:18 +0200 Subject: add not accurate timer wheel for better performance Signed-off-by: Hanoh Haim --- .../automation/trex_control_plane/stf/examples/stf_active_flow.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'scripts/automation/trex_control_plane/stf') 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)) -- cgit From 734ce41c65a49b0a74b515c7d9c6a2b888bbddb9 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Sun, 15 Jan 2017 06:31:23 +0200 Subject: STF API: fix latency check after it was not checked in previous run Change-Id: Ic8cd116bc29c991abff9837e9da4ef0ea37bb497 Signed-off-by: Yaroslav Brustinov --- scripts/automation/trex_control_plane/stf/trex_stf_lib/trex_client.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'scripts/automation/trex_control_plane/stf') 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..2b880389 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 -- cgit From 420216e583706fbd7bf214818fcce0143a05e982 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 12 Jan 2017 13:47:39 +0200 Subject: add elk Signed-off-by: Hanoh Haim --- .../stf/trex_stf_lib/trex_client.py | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) (limited to 'scripts/automation/trex_control_plane/stf') 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 2b880389..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 @@ -1116,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() ) + @@ -1162,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 @@ -1397,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) @@ -1424,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 @@ -1486,6 +1522,21 @@ class CTRexResult(object): res[tmp_key] = val # don't touch original fields values 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 = {} -- cgit