From eff9ff971acf5c7208ab2b824b897d3183c36f3c Mon Sep 17 00:00:00 2001 From: ahothan Date: Tue, 24 Apr 2018 16:35:30 -0700 Subject: [NFVBENCH-88] Fixed rate run: reported RX rate should be swapped in Run Config Table swap the RX rates so that each direction has the far end RX rates Change-Id: Ib78b7721b07285f5173ca8d6f29f18873eb91df9 Signed-off-by: ahothan --- nfvbench/traffic_client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/nfvbench/traffic_client.py b/nfvbench/traffic_client.py index 25fb871..5305da9 100755 --- a/nfvbench/traffic_client.py +++ b/nfvbench/traffic_client.py @@ -832,9 +832,11 @@ class TrafficClient(object): def get_run_config(self, results): """Return configuration which was used for the last run.""" r = {} + # because we want each direction to have the far end RX rates, + # use the far end index (1-idx) to retrieve the RX rates for idx, key in enumerate(["direction-forward", "direction-reverse"]): tx_rate = results["stats"][idx]["tx"]["total_pkts"] / self.config.duration_sec - rx_rate = results["stats"][idx]["rx"]["total_pkts"] / self.config.duration_sec + rx_rate = results["stats"][1 - idx]["rx"]["total_pkts"] / self.config.duration_sec r[key] = { "orig": self.__convert_rates(self.run_config['rates'][idx]), "tx": self.__convert_rates({'rate_pps': tx_rate}), -- cgit 1.2.3-korg