summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIdo Barnea <ibarnea@cisco.com>2016-05-29 16:03:26 +0300
committerIdo Barnea <ibarnea@cisco.com>2016-05-29 16:03:26 +0300
commitf2abf803461fb88d59f31398764d946f982b4647 (patch)
tree27714689a1cc7d91dd5f8097b8576d2089b9b873
parentdad5f59181ad000c5e43d96037377d9f1ce2d57a (diff)
Handle latency min when there are no samples
-rw-r--r--scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py3
1 files changed, 2 insertions, 1 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 ee4bd1f9..ae1adc2d 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
@@ -1033,7 +1033,8 @@ class CLatencyStats(CTRexStats):
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())
+ if output[int_pg_id]['latency']['histogram'].keys() != []:
+ output[int_pg_id]['latency']['total_min'] = min(output[int_pg_id]['latency']['histogram'].keys())
self.latest_stats = output
return True