From f2abf803461fb88d59f31398764d946f982b4647 Mon Sep 17 00:00:00 2001 From: Ido Barnea Date: Sun, 29 May 2016 16:03:26 +0300 Subject: Handle latency min when there are no samples --- .../automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'scripts/automation/trex_control_plane/stl/trex_stl_lib/trex_stl_stats.py') 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 -- cgit 1.2.3-korg