diff options
author | Hanoh Haim <hhaim@cisco.com> | 2016-05-22 16:25:06 +0300 |
---|---|---|
committer | Hanoh Haim <hhaim@cisco.com> | 2016-05-22 16:25:06 +0300 |
commit | 6b12595f08d7d655d398e73753f3dad67982e856 (patch) | |
tree | 42c22e413b06756ac7e6a10161081a36b77f151b | |
parent | fddd473cf780027ee9f0c45eaefe0a5a70127fd4 (diff) | |
parent | 9f266bd7202556cb6d83913282a0b410c1ff42d4 (diff) |
Merge v2.01
-rw-r--r-- | scripts/automation/trex_control_plane/stl/examples/stl_flow_latency_stats.py | 2 | ||||
-rw-r--r-- | scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/scripts/automation/trex_control_plane/stl/examples/stl_flow_latency_stats.py b/scripts/automation/trex_control_plane/stl/examples/stl_flow_latency_stats.py index ea0ba221..df0605bf 100644 --- a/scripts/automation/trex_control_plane/stl/examples/stl_flow_latency_stats.py +++ b/scripts/automation/trex_control_plane/stl/examples/stl_flow_latency_stats.py @@ -78,6 +78,7 @@ def rx_iteration (c, tx_port, rx_port, total_pkts, pkt_len, bw): jitter = lat['jitter'] avg = lat['average'] tot_max = lat['total_max'] + tot_min = lat['total_min'] last_max = lat['last_max'] hist = lat ['histogram'] @@ -90,6 +91,7 @@ def rx_iteration (c, tx_port, rx_port, total_pkts, pkt_len, bw): print('Error counters: dropped:{0}, ooo:{1} dup:{2} seq too high:{3} seq too low:{4}'.format(drops, ooo, dup, sth, stl)) print('Latency info:') print(" Maximum latency(usec): {0}".format(tot_max)) + print(" Minimum latency(usec): {0}".format(tot_min)) print(" Maximum latency in last sampling period (usec): {0}".format(last_max)) print(" Average latency(usec): {0}".format(avg)) print(" Jitter(usec): {0}".format(jitter)) diff --git a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py index f9db22a1..98a08d55 100644 --- a/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py +++ b/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py @@ -980,7 +980,15 @@ class CLatencyStats(CTRexStats): output[int_pg_id]['latency']['total_max'] = current_pg['latency']['h']['max_usec'] output[int_pg_id]['latency']['histogram'] = current_pg['latency']['h']['histogram'] zero_count = current_pg['latency']['h']['cnt'] - current_pg['latency']['h']['high_cnt'] - output[int_pg_id]['latency']['histogram'].append({'key':0, 'val':zero_count}) + if zero_count != 0: + output[int_pg_id]['latency']['histogram'].append({'key':0, 'val':zero_count}) + output[int_pg_id]['latency']['total_min'] = 1 + else: + min_usec = current_pg['latency']['h']['max_usec'] + for bucket in output[int_pg_id]['latency']['histogram']: + if bucket['key'] < min_usec: + min_usec = bucket['key'] + output[int_pg_id]['latency']['total_min'] = min_usec self.latest_stats = output return True |