summaryrefslogtreecommitdiffstats
path: root/scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py')
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py10
1 files changed, 8 insertions, 2 deletions
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 6b34b11a..ee4bd1f9 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
@@ -1026,9 +1026,15 @@ class CLatencyStats(CTRexStats):
if current_pg['latency']['h'] != "":
output[int_pg_id]['latency']['average'] = current_pg['latency']['h']['s_avg']
output[int_pg_id]['latency']['total_max'] = current_pg['latency']['h']['max_usec']
- output[int_pg_id]['latency']['histogram'] = {elem['key']: elem['val'] for elem in current_pg['latency']['h']['histogram']}
+ output[int_pg_id]['latency']['histogram'] = {elem['key']: elem['val']
+ for elem in current_pg['latency']['h']['histogram']}
zero_count = current_pg['latency']['h']['cnt'] - current_pg['latency']['h']['high_cnt']
- output[int_pg_id]['latency']['histogram'][0] = zero_count
+ if zero_count != 0:
+ output[int_pg_id]['latency']['total_min'] = 1
+ output[int_pg_id]['latency']['histogram'][0] = zero_count
+ else:
+ output[int_pg_id]['latency']['total_min'] = min(output[int_pg_id]['latency']['histogram'].keys())
+
self.latest_stats = output
return True