Added easy to customize variables

This commit is contained in:
Sean Corrigan 2020-07-27 21:07:03 -04:00
parent 1797e6aafd
commit 1ef27c096e

View File

@ -3,6 +3,10 @@ import speedtest
import json import json
from influxdb import InfluxDBClient from influxdb import InfluxDBClient
serverip = "192.168.0.13"
serverport = 8086
serverdatabase = "telegraf"
def speed(): # To be called on schedule def speed(): # To be called on schedule
servers = [] # If you want to test against a specific server servers = [] # If you want to test against a specific server
threads = 4 threads = 4
@ -35,7 +39,7 @@ def speed(): # To be called on schedule
def influxupload(): # Still having errors in uploading the data.. def influxupload(): # Still having errors in uploading the data..
jsondata = speed() jsondata = speed()
client = InfluxDBClient(host='192.168.0.13', port=8086, database='telegraf') client = InfluxDBClient(host=serverip, port=8086, database=serverdatabase)
client.write(str(jsondata), protocol='json') client.write(str(jsondata), protocol='json')
influxupload() influxupload()