aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormortenhillbom <mhillbom@cisco.com>2018-04-11 15:35:23 -0700
committermortenhillbom <mhillbom@cisco.com>2018-04-12 12:02:10 -0700
commit63bab64fe0babc5a198d0a0457c4fb0a58cfe32f (patch)
tree3a8d520829617101c5a83d7e82de9683addb6154
parent6226413ca6e1b4c3a52a3deeb66f8f487c2704ae (diff)
NFVBENCH-84 Report results with requested L2 frame size
Change-Id: Ie7a8795cd0cb16b881a4e2aec68ff1e3dd6741b1 Signed-off-by: mortenhillbom <mhillbom@cisco.com>
-rw-r--r--nfvbench/nfvbench.py2
-rw-r--r--nfvbench/service_chain.py15
-rw-r--r--nfvbench/summarizer.py6
3 files changed, 18 insertions, 5 deletions
diff --git a/nfvbench/nfvbench.py b/nfvbench/nfvbench.py
index 90b16d4..dd4a1a3 100644
--- a/nfvbench/nfvbench.py
+++ b/nfvbench/nfvbench.py
@@ -105,7 +105,7 @@ class NFVBench(object):
new_frame_sizes.append(frame_size)
except ValueError:
new_frame_sizes.append(frame_size)
- self.config.frame_sizes = tuple(new_frame_sizes)
+ self.config.actual_frame_sizes = tuple(new_frame_sizes)
result = {
"date": datetime.datetime.now().strftime('%Y-%m-%d %H:%M:%S'),
"nfvbench_version": __version__,
diff --git a/nfvbench/service_chain.py b/nfvbench/service_chain.py
index 216cc92..7ec1511 100644
--- a/nfvbench/service_chain.py
+++ b/nfvbench/service_chain.py
@@ -57,14 +57,14 @@ class ServiceChain(object):
for vlan, device in zip(vlans, self.config.generator_config.devices):
self.stats_manager.set_vlan_tag(device, vlan)
- def __get_result_per_frame_size(self, frame_size, bidirectional):
+ def __get_result_per_frame_size(self, frame_size, actual_frame_size, bidirectional):
start_time = time.time()
traffic_result = {
frame_size: {}
}
result = {}
if not self.config.no_traffic:
- self.clients['traffic'].set_traffic(frame_size, bidirectional)
+ self.clients['traffic'].set_traffic(actual_frame_size, bidirectional)
if self.config.single_run:
result = self.stats_manager.run()
@@ -73,6 +73,9 @@ class ServiceChain(object):
for dr in ['pdr', 'ndr']:
if dr in results:
+ if frame_size != actual_frame_size:
+ results[dr]['l2frame_size'] = frame_size
+ results[dr]['actual_l2frame_size'] = actual_frame_size
traffic_result[frame_size][dr] = results[dr]
if 'warning' in results[dr]['stats'] and results[dr]['stats']['warning']:
traffic_result['warning'] = results[dr]['stats']['warning']
@@ -83,6 +86,8 @@ class ServiceChain(object):
result['run_config'] = self.clients['traffic'].get_run_config(result)
required = result['run_config']['direction-total']['orig']['rate_pps']
actual = result['stats']['total_tx_rate']
+ if frame_size != actual_frame_size:
+ result['actual_l2frame_size'] = actual_frame_size
warning = self.clients['traffic'].compare_tx_rates(required, actual)
if warning is not None:
result['run_config']['warning'] = warning
@@ -92,8 +97,10 @@ class ServiceChain(object):
def __get_chain_result(self):
result = OrderedDict()
- for fs in self.config.frame_sizes:
- result.update(self.__get_result_per_frame_size(fs, self.config.traffic.bidirectional))
+ for fs, actual_fs in zip(self.config.frame_sizes, self.config.actual_frame_sizes):
+ result.update(self.__get_result_per_frame_size(fs,
+ actual_fs,
+ self.config.traffic.bidirectional))
chain_result = {
'flow_count': self.config.flow_count,
diff --git a/nfvbench/summarizer.py b/nfvbench/summarizer.py
index d8c761d..b27ed6f 100644
--- a/nfvbench/summarizer.py
+++ b/nfvbench/summarizer.py
@@ -317,6 +317,12 @@ class NFVBenchSummarizer(Summarizer):
def __chain_analysis_summarize(self, frame_size, analysis):
self._put()
self._put('L2 frame size:', frame_size)
+ if 'actual_l2frame_size' in analysis:
+ self._put('Actual l2 frame size:', analysis['actual_l2frame_size'])
+ elif self.config['ndr_run'] and 'actual_l2frame_size' in analysis['ndr']:
+ self._put('Actual l2 frame size:', analysis['ndr']['actual_l2frame_size'])
+ elif self.config['pdr_run'] and 'actual_l2frame_size' in analysis['pdr']:
+ self._put('Actual l2 frame size:', analysis['pdr']['actual_l2frame_size'])
if 'analysis_duration_sec' in analysis:
self._put('Chain analysis duration:',
Formatter.float(3)(analysis['analysis_duration_sec']), 'seconds')