[NFVBENCH-88] Fixed rate run: reported RX rate should be swapped in Run Config Table 41/56441/1
authorahothan <ahothan@cisco.com>
Tue, 24 Apr 2018 23:35:30 +0000 (16:35 -0700)
committerahothan <ahothan@cisco.com>
Tue, 24 Apr 2018 23:35:30 +0000 (16:35 -0700)
swap the RX rates so that each direction has the far end RX rates

Change-Id: Ib78b7721b07285f5173ca8d6f29f18873eb91df9
Signed-off-by: ahothan <ahothan@cisco.com>
nfvbench/traffic_client.py

index 25fb871..5305da9 100755 (executable)
@@ -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}),