From bd0cf4ce9c30c8aae9b7a96cf9c8ea073cd9a548 Mon Sep 17 00:00:00 2001 From: Pierrick Louin Date: Sun, 8 Nov 2020 21:49:49 +0100 Subject: NFVBENCH-192: Complete/fix hdrh related processings to consider all cases (multiple service chains, distribution n/a with intel VFs) Signed-off-by: Pierrick Louin Change-Id: I80e38601292a7777d37ed05959c8ef205505c2ac --- nfvbench/summarizer.py | 34 +++++++++++++++++++++------------- 1 file changed, 21 insertions(+), 13 deletions(-) (limited to 'nfvbench/summarizer.py') diff --git a/nfvbench/summarizer.py b/nfvbench/summarizer.py index bbd5908..7e2d129 100644 --- a/nfvbench/summarizer.py +++ b/nfvbench/summarizer.py @@ -263,8 +263,8 @@ class NFVBenchSummarizer(Summarizer): # add percentiles headers if hdrh enabled if not self.config.disable_hdrh: for percentile in self.config.lat_percentiles: - self.ndr_pdr_header.append((str(percentile) + ' %ile lat.', Formatter.standard)) - self.single_run_header.append((str(percentile) + ' %ile lat.', Formatter.standard)) + self.ndr_pdr_header.append(str(percentile) + ' %ile lat.', Formatter.standard) + self.single_run_header.append(str(percentile) + ' %ile lat.', Formatter.standard) # if sender is available initialize record if self.sender: self.__record_init() @@ -481,6 +481,7 @@ class NFVBenchSummarizer(Summarizer): self.extract_hdrh_percentiles( analysis['stats']['overall']['rx']['lat_percentile'], row_data) summary_table.add_row(row_data) + single_run_data = { 'type': 'single_run', 'offered_tx_rate_bps': analysis['stats']['offered_tx_rate_bps'], @@ -556,29 +557,36 @@ class NFVBenchSummarizer(Summarizer): 'lat_min_usec': 'Min lat.', 'lat_max_usec': 'Max lat.'} if 'lat_avg_usec' in chains['0']: - lat_keys = ['lat_avg_usec', 'lat_min_usec', 'lat_max_usec', 'lat_percentile'] + lat_keys = ['lat_avg_usec', 'lat_min_usec', 'lat_max_usec'] if not self.config.disable_hdrh: + lat_keys.append('lat_percentile') for percentile in self.config.lat_percentiles: - lat_map['lat_' + str(percentile) + '_percentile'] = str( - percentile) + ' %ile lat.' + lat_map['lat_' + str(percentile) + '_percentile'] = \ + str(percentile) + ' %ile lat.' for key in lat_map: - header.append((lat_map[key], Formatter.standard)) + header.append(lat_map[key], Formatter.standard) table = Table(header) for chain in sorted(list(chains.keys()), key=str): row = [chain] + chains[chain]['packets'] for lat_key in lat_keys: - if chains[chain].get(lat_key, None): - if lat_key == 'lat_percentile': - if not self.config.disable_hdrh: - for percentile in chains[chain][lat_key]: - row.append(Formatter.standard(chains[chain][lat_key][percentile])) - else: + + if lat_key != 'lat_percentile': + if chains[chain].get(lat_key, None): row.append(Formatter.standard(chains[chain][lat_key])) + else: + row.append('n/a') else: - row.append('--') + if not self.config.disable_hdrh: + if chains[chain].get(lat_key, None): + for percentile in chains[chain][lat_key]: + row.append(Formatter.standard( + chains[chain][lat_key][percentile])) + else: + for percentile in self.config.lat_percentiles: + row.append('n/a') table.add_row(row) return table -- cgit 1.2.3-korg