Fix KPI data reported by ProxBinSearchProfile 99/60899/2
authorSerhiy Pshyk <serhiyx.pshyk@intel.com>
Mon, 13 Aug 2018 14:16:44 +0000 (15:16 +0100)
committerSerhiy Pshyk <serhiyx.pshyk@intel.com>
Mon, 13 Aug 2018 14:31:28 +0000 (14:31 +0000)
List of changes made in ProxBinSearchProfile:
  - Removed reporting of redundant records with zero values
  - Fixed issue with results data from one step reported in the next step
  - Added 'Step_Id' field to reflect to which search step current record belongs
  - Added 'Confirmation_Retry' field to reflect retry number of current test.
    This value depends on 'confirmation' configuration option of a runner.

JIRA: YARDSTICK-1379

Change-Id: Idc3f7e26ece41ac0dfbfee659daf310a2879e024
Signed-off-by: Serhiy Pshyk <serhiyx.pshyk@intel.com>
yardstick/network_services/traffic_profile/prox_binsearch.py

index 9457096..506a880 100644 (file)
@@ -88,11 +88,6 @@ class ProxBinSearchProfile(ProxProfile):
         theor_max_thruput = actual_max_thruput = 0
 
         result_samples = {}
-        rate_samples = {}
-        pos_retry = 0
-        neg_retry = 0
-        total_retry = 0
-        ok_retry = 0
 
         # Store one time only value in influxdb
         single_samples = {
@@ -110,15 +105,11 @@ class ProxBinSearchProfile(ProxProfile):
             "interface_speed_gbps", constants.NIC_GBPS_DEFAULT) * constants.ONE_GIGABIT_IN_BITS
 
         ok_retry = traffic_gen.scenario_helper.scenario_cfg["runner"].get("confirmation", 0)
-        for test_value in self.bounds_iterator(LOG):
+        for step_id, test_value in enumerate(self.bounds_iterator(LOG)):
             pos_retry = 0
             neg_retry = 0
             total_retry = 0
 
-            rate_samples["MAX_Rate"] = self.current_upper
-            rate_samples["MIN_Rate"] = self.current_lower
-            rate_samples["Test_Rate"] = test_value
-            self.queue.put(rate_samples, True, overall_constants.QUEUE_PUT_TIMEOUT)
             LOG.info("Checking MAX %s MIN %s TEST %s",
                 self.current_upper, self.lower_bound, test_value)
             while (pos_retry <= ok_retry) and (neg_retry <= ok_retry):
@@ -188,6 +179,11 @@ class ProxBinSearchProfile(ProxProfile):
                     self.queue.put({'theor_max_throughput': theor_max_thruput})
 
                 LOG.info(">>>##>>Collect TG KPIs %s %s", datetime.datetime.now(), samples)
+                samples["MAX_Rate"] = self.current_upper
+                samples["MIN_Rate"] = self.current_lower
+                samples["Test_Rate"] = test_value
+                samples["Step_Id"] = step_id
+                samples["Confirmation_Retry"] = total_retry
                 self.queue.put(samples, True, overall_constants.QUEUE_PUT_TIMEOUT)
 
         LOG.info(">>>##>> Result Reached PktSize %s Theor_Max_Thruput %s Actual_throughput %s",