From: ahothan Date: Tue, 24 Apr 2018 23:35:30 +0000 (-0700) Subject: [NFVBENCH-88] Fixed rate run: reported RX rate should be swapped in Run Config Table X-Git-Tag: 1.4.1~1 X-Git-Url: https://gerrit.opnfv.org/gerrit/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F41%2F56441%2F1;p=nfvbench.git [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 --- 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}),