From cb55f42f183e631aec06ecb7d1ad953ad71b57d2 Mon Sep 17 00:00:00 2001 From: Yaroslav Brustinov Date: Tue, 26 Apr 2016 05:32:09 +0300 Subject: stateful api: fix filter max latency regression: fix bw_per_core at trex09 based on regression --- .../regression/setups/trex09/benchmark.yaml | 14 +++++----- .../stf/trex_stf_lib/trex_client.py | 30 ++++++++++------------ 2 files changed, 21 insertions(+), 23 deletions(-) (limited to 'scripts/automation') diff --git a/scripts/automation/regression/setups/trex09/benchmark.yaml b/scripts/automation/regression/setups/trex09/benchmark.yaml index 7de79c14..bb90acb0 100644 --- a/scripts/automation/regression/setups/trex09/benchmark.yaml +++ b/scripts/automation/regression/setups/trex09/benchmark.yaml @@ -6,44 +6,44 @@ test_jumbo: multiplier : 110 cores : 1 - bw_per_core : 962464 + bw_per_core : 767198 test_routing_imix: multiplier : 64 cores : 2 - bw_per_core : 55130 + bw_per_core : 35889 test_routing_imix_64: multiplier : 5000 cores : 2 - bw_per_core : 11699 + bw_per_core : 10672 test_static_routing_imix_asymmetric: multiplier : 32 cores : 1 - bw_per_core : 50561 + bw_per_core : 52738 test_ipv6_simple: multiplier : 64 cores : 4 - bw_per_core : 25948 + bw_per_core : 22808 test_rx_check_http: multiplier : 90000 cores : 2 rx_sample_rate : 32 - bw_per_core : 49464 + bw_per_core : 46075 test_rx_check_sfr: multiplier : 50 cores : 3 rx_sample_rate : 32 - bw_per_core : 20871 + bw_per_core : 20469 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 f5887120..7f241620 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 @@ -1289,26 +1289,24 @@ class CTRexResult(object): def __get_filtered_max_latency (src_dict, filtered_latency_amount = 0.001): result = {} for port, data in src_dict.items(): - if port.startswith('port-'): - max_port = 'max-%s' % port[5:] - res = data['hist'] - if not len(res['histogram']): - result[max_port] = 0 - continue - hist_last_keys = deque([res['histogram'][-1]['key']], maxlen = 2) - sum_high = 0.0 - for elem in reversed(res['histogram']): - sum_high += elem['val'] - hist_last_keys.append(elem['key']) - if sum_high >= filtered_latency_amount * res['cnt']: - break - result[max_port] = (hist_last_keys[0] + hist_last_keys[-1]) / 2 - else: - return {} + if not port.startswith('port-'): + continue + max_port = 'max-%s' % port[5:] + res = data['hist'] + if not len(res['histogram']): + result[max_port] = 0 + continue + sum_high = 0.0 + for elem in reversed(res['histogram']): + sum_high += elem['val'] + if sum_high >= filtered_latency_amount * res['cnt']: + result[max_port] = elem['key'] + int('5' + repr(elem['key'])[2:]) + break return result + if __name__ == "__main__": pass -- cgit 1.2.3-korg