diff options
author | Xavier Simonart <xavier.simonart@intel.com> | 2018-06-01 12:16:38 +0200 |
---|---|---|
committer | DanielMartinBuckley <daniel.m.buckley@intel.com> | 2018-06-05 16:15:52 +0100 |
commit | 68aaa8ce8b20ba39040aa2469b384f59709620a7 (patch) | |
tree | e0c4168e8649c8cc55cea11a1e4ef33f9aee9008 /yardstick/network_services/traffic_profile | |
parent | d6c1b8b7bfd257efd5fe2df30dd450bdb2c57c7d (diff) |
Fix NSB NFVi metrics accuracy
JIRA: YARDSTICK-1212
Change-Id: Ic4d4a3c00e4e278f4de06cc176ff663892895569
Signed-off-by: Xavier Simonart <xavier.simonart@intel.com>
Diffstat (limited to 'yardstick/network_services/traffic_profile')
-rw-r--r-- | yardstick/network_services/traffic_profile/prox_binsearch.py | 24 |
1 files changed, 10 insertions, 14 deletions
diff --git a/yardstick/network_services/traffic_profile/prox_binsearch.py b/yardstick/network_services/traffic_profile/prox_binsearch.py index 1e926aca2..225ee4356 100644 --- a/yardstick/network_services/traffic_profile/prox_binsearch.py +++ b/yardstick/network_services/traffic_profile/prox_binsearch.py @@ -108,7 +108,6 @@ class ProxBinSearchProfile(ProxProfile): self.tolerated_loss, line_speed) self.curr_time = time.time() - diff_time = self.curr_time - self.prev_time self.prev_time = self.curr_time if result.success: @@ -120,10 +119,11 @@ class ProxBinSearchProfile(ProxProfile): # store results with success tag in influxdb success_samples = {'Success_' + key: value for key, value in samples.items()} - success_samples["Success_rx_total"] = int(result.rx_total / diff_time) - success_samples["Success_tx_total"] = int(result.tx_total / diff_time) - success_samples["Success_can_be_lost"] = int(result.can_be_lost / diff_time) - success_samples["Success_drop_total"] = int(result.drop_total / diff_time) + # Store number of packets based statistics (we already have throughput) + success_samples["Success_rx_total"] = int(result.rx_total) + success_samples["Success_tx_total"] = int(result.tx_total) + success_samples["Success_can_be_lost"] = int(result.can_be_lost) + success_samples["Success_drop_total"] = int(result.drop_total) self.queue.put(success_samples) # Store Actual throughput for result samples @@ -133,20 +133,16 @@ class ProxBinSearchProfile(ProxProfile): LOG.debug("Failure... Decreasing upper bound") self.current_upper = test_value samples = result.get_samples(pkt_size, successful_pkt_loss, port_samples) + # samples contains data such as Latency, Throughput, number of packets + # Hence they should not be divided by the time difference - for k in samples: - tmp = samples[k] - if isinstance(tmp, dict): - for k2 in tmp: - samples[k][k2] = int(samples[k][k2] / diff_time) - - if theor_max_thruput < samples["TxThroughput"]: - theor_max_thruput = samples['TxThroughput'] + if theor_max_thruput < samples["RequestedTxThroughput"]: + theor_max_thruput = samples['RequestedTxThroughput'] self.queue.put({'theor_max_throughput': theor_max_thruput}) LOG.debug("Collect TG KPIs %s %s", datetime.datetime.now(), samples) self.queue.put(samples) result_samples["Result_pktSize"] = pkt_size - result_samples["Result_theor_max_throughput"] = theor_max_thruput/(1000 * 1000) + result_samples["Result_theor_max_throughput"] = theor_max_thruput self.queue.put(result_samples) |