summaryrefslogtreecommitdiffstats
path: root/nfvbench/traffic_client.py
diff options
context:
space:
mode:
authorKerim Gokarslan <kgokarsl@cisco.com>2017-09-19 15:33:46 -0700
committerKerim Gokarslan <kgokarsl@cisco.com>2017-09-19 15:33:46 -0700
commited44014fcbd625cd464a6a7f7b88c02b9b7a29f5 (patch)
treea51ea7c7d3619e32c7a56ec954587fa5d79a8cad /nfvbench/traffic_client.py
parent230d84f20f70ebcbafa1f8f3d32461649c8c49b1 (diff)
NFVBENCH-28 Set result values for NDR/PDR if they cannot be found within the given epsilon
Change-Id: Id8019c7f052c2b189f3ab6e39377f65fe00d9fee Signed-off-by: Kerim Gokarslan <kgokarsl@cisco.com>
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