Added easy to customize variables
This commit is contained in:
parent
1797e6aafd
commit
1ef27c096e
6
main.py
6
main.py
@ -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()
|
||||||
Reference in New Issue
Block a user