From 2f4418798a3cf245f863a617410403f226062ac8 Mon Sep 17 00:00:00 2001 From: Patrice Buriez Date: Mon, 1 Oct 2018 13:36:33 +0200 Subject: Fix influxdb "field type conflict" error JIRA: YARDSTICK-1457 Field types must be consistent across points in a measurement, otherwise influxdb rejects newer points with "field type conflict" error. This error was faced when "theor_max_throughput" field, meant to be assigned as a float from "TxThroughput" sample, was instead assigned as an int from initial value of theor_max_thruput variable. This especially occured for subsequent packet sizes, when theor_max_thruput variable was reset to its default int value. This fix changes the default value of theor_max_thruput variable to 0.0, and also makes sure that the default value for "Actual_throughput" field is consistently a float. Change-Id: If8d4f1297094709fe9657ab3e2b8adaad09815b2 Signed-off-by: Patrice Buriez --- yardstick/network_services/traffic_profile/prox_binsearch.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/yardstick/network_services/traffic_profile/prox_binsearch.py b/yardstick/network_services/traffic_profile/prox_binsearch.py index 16a0411ec..9d9727214 100644 --- a/yardstick/network_services/traffic_profile/prox_binsearch.py +++ b/yardstick/network_services/traffic_profile/prox_binsearch.py @@ -93,7 +93,7 @@ class ProxBinSearchProfile(ProxProfile): # success, the binary search will complete on an integer multiple # of the precision, rather than on a fraction of it. - theor_max_thruput = 0 + theor_max_thruput = 0.0 result_samples = {} @@ -195,9 +195,9 @@ class ProxBinSearchProfile(ProxProfile): LOG.info( ">>>##>> Result Reached PktSize %s Theor_Max_Thruput %s Actual_throughput %s", - pkt_size, theor_max_thruput, result_samples.get("RxThroughput", 0)) + pkt_size, theor_max_thruput, result_samples.get("RxThroughput", 0.0)) result_samples["Status"] = STATUS_RESULT result_samples["Next_Step"] = "" - result_samples["Actual_throughput"] = result_samples.get("RxThroughput", 0) + result_samples["Actual_throughput"] = result_samples.get("RxThroughput", 0.0) result_samples["theor_max_throughput"] = theor_max_thruput self.queue.put(result_samples) -- cgit 1.2.3-korg