Merge "Add --hwlb options as a command line argument for SampleVNF"
[yardstick.git] / yardstick / network_services / traffic_profile / prox_binsearch.py
index 5700f98..7a84f13 100644 (file)
@@ -20,6 +20,7 @@ import datetime
 import time
 
 from yardstick.network_services.traffic_profile.prox_profile import ProxProfile
+from yardstick.network_services import constants
 
 LOG = logging.getLogger(__name__)
 
@@ -99,9 +100,13 @@ class ProxBinSearchProfile(ProxProfile):
 
         # throughput and packet loss from the most recent successful test
         successful_pkt_loss = 0.0
+        line_speed = traffic_gen.scenario_helper.all_options.get(
+            "interface_speed_gbps", constants.NIC_GBPS_DEFAULT) * constants.ONE_GIGABIT_IN_BITS
         for test_value in self.bounds_iterator(LOG):
             result, port_samples = self._profile_helper.run_test(pkt_size, duration,
-                                                                 test_value, self.tolerated_loss)
+                                                                 test_value,
+                                                                 self.tolerated_loss,
+                                                                 line_speed)
             self.curr_time = time.time()
             diff_time = self.curr_time - self.prev_time
             self.prev_time = self.curr_time
@@ -111,7 +116,6 @@ class ProxBinSearchProfile(ProxProfile):
                 self.current_lower = test_value
                 successful_pkt_loss = result.pkt_loss
                 samples = result.get_samples(pkt_size, successful_pkt_loss, port_samples)
-                samples["TxThroughput"] = samples["TxThroughput"] * 1000 * 1000
 
                 # store results with success tag in influxdb
                 success_samples = {'Success_' + key: value for key, value in samples.items()}