From 648b2b5fa70aeeaa6a8832677069c7216866de69 Mon Sep 17 00:00:00 2001 From: imp4ct Date: Tue, 28 Jul 2020 17:13:36 -0400 Subject: [PATCH] Added nickname to Test --- main.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index 4ba6189..56dff79 100644 --- a/main.py +++ b/main.py @@ -1,4 +1,6 @@ # Sean Corrigan 2020 +# Script sends data to influx in bits/sec + import speedtest import json from influxdb import InfluxDBClient @@ -6,10 +8,10 @@ from influxdb import InfluxDBClient serverip = "192.168.0.13" serverport = 8086 serverdatabase = "telegraf" -servernickname = 'PythonSpeedtest' +servernickname = 'Yoo01pn.ddns.net' def speed(): # Actual Speedtest using speedtest-cli - servers = [] # If you want to test against a specific server + servers = [] # If you want to test against a specific server eg. threads = 4 # Choose the amount of threads to use for the test test = speedtest.Speedtest() @@ -49,7 +51,7 @@ def uploadInfluxdata(host='192.168.0.13', port=8086): # Main upload section } } ] - #"time": "2009-11-10T23:00:00Z", + client = InfluxDBClient(host, port, database = serverdatabase) # Init connection to Influx Server client.write_points(json_body) # Write Speedtest results