diff options
author | mortenhillbom <mhillbom@cisco.com> | 2018-04-11 15:35:23 -0700 |
---|---|---|
committer | mortenhillbom <mhillbom@cisco.com> | 2018-04-12 12:02:10 -0700 |
commit | 63bab64fe0babc5a198d0a0457c4fb0a58cfe32f (patch) | |
tree | 3a8d520829617101c5a83d7e82de9683addb6154 /nfvbench/service_chain.py | |
parent | 6226413ca6e1b4c3a52a3deeb66f8f487c2704ae (diff) |
NFVBENCH-84 Report results with requested L2 frame size
Change-Id: Ie7a8795cd0cb16b881a4e2aec68ff1e3dd6741b1
Signed-off-by: mortenhillbom <mhillbom@cisco.com>
Diffstat (limited to 'nfvbench/service_chain.py')
-rw-r--r-- | nfvbench/service_chain.py | 15 |
1 files changed, 11 insertions, 4 deletions
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, |