aboutsummaryrefslogtreecommitdiffstats
path: root/nfvbench/traffic_client.py
diff options
context:
space:
mode:
Diffstat (limited to 'nfvbench/traffic_client.py')
-rw-r--r--nfvbench/traffic_client.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/nfvbench/traffic_client.py b/nfvbench/traffic_client.py
index 27ff227..4337ad3 100644
--- a/nfvbench/traffic_client.py
+++ b/nfvbench/traffic_client.py
@@ -640,6 +640,21 @@ class TrafficClient(object):
})
right_targets[tag] = target
else:
+ # initialize to 0 all fields of result for
+ # the worst case scenario of the binary search (if ndr/pdr is not found)
+ if tag not in results:
+ results[tag] = dict.fromkeys(rates, 0)
+ empty_stats = self.__format_output_stats(dict(stats))
+ for key in empty_stats:
+ if isinstance(empty_stats[key], dict):
+ empty_stats[key] = dict.fromkeys(empty_stats[key], 0)
+ else:
+ empty_stats[key] = 0
+ results[tag].update({
+ 'load_percent_per_direction': 0,
+ 'stats': empty_stats,
+ 'timestamp_sec': None
+ })
left_targets[tag] = target
# search lower half