1 from __future__ import print_function
8 from influxdb import InfluxDBClient
10 time_stamp=sys.argv[1]
12 results_dir=sys.argv[3]
14 def publish_results(testtype):
15 for file in glob.glob("*.csv"):
18 reader = csv.DictReader( f )
19 result = json.dumps( [ row for row in reader ] )
20 result = ast.literal_eval(result)
24 test = i['id'] + '_' +testtype
31 "packet_size": i['packet_size']
35 "min_value": i['min_latency_ns'],
36 "avg_value": i['avg_latency_ns'],
37 "max_value": i['max_latency_ns']
42 client = InfluxDBClient('104.197.68.199', 8086, 'opnfv', '0pnfv2015', 'yardstick')
43 client.switch_database('yardstick')
44 client.write_points(json_body)
47 publish_results(test_type)