From f5a60cbbfd999c6012e1c633d58e5b0f1938a7ff Mon Sep 17 00:00:00 2001 From: Jo¶rgen Karlsson Date: Tue, 23 Feb 2016 13:10:00 +0100 Subject: iperf3: fix for influxDb schema errors MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Convert integers to float before dumping to influxDb. Iperf3 is not always consistent about data types in its JSON output. This may cause schema errors when values with different types (integer and float) are written to the same field in InfluxDb. This is a quick fix. A Future improvement would be to write a format func for the data. Change-Id: I7011adc19693f91db5889554fd6bec0d46dc6679 Signed-off-by: Jo¶rgen Karlsson --- yardstick/benchmark/scenarios/networking/iperf3.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/yardstick/benchmark/scenarios/networking/iperf3.py b/yardstick/benchmark/scenarios/networking/iperf3.py index 86610c88f..bb41c3df1 100644 --- a/yardstick/benchmark/scenarios/networking/iperf3.py +++ b/yardstick/benchmark/scenarios/networking/iperf3.py @@ -132,7 +132,10 @@ For more info see http://software.es.net/iperf # error cause in json dict on stdout raise RuntimeError(stdout) - result.update(json.loads(stdout)) + # Note: convert all ints to floats in order to avoid + # schema conflicts in influxdb. We probably should add + # a format func in the future. + result.update(json.loads(stdout, parse_int=float)) if "sla" in self.scenario_cfg: sla_iperf = self.scenario_cfg["sla"] -- cgit 1.2.3-korg