diff --git a/README.md b/README.md index 9132899..cb7a2da 100644 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ There are some added features to allow some additional details that Ookla provid * Slightly different environment variables to set up InfluxDB connection * Speeds will be returned in bytes without transforming into MBit/s, just like the speedtest does -* The measure duplication of `speeds>bandwith_up/down` and `download>bandwith` and `upload>bandwith` has been removed, leaving only the `speeds` fields. +* The measure duplication of `speeds>bandwith_up/down` and `download>bandwith` and `upload>bandwith` has been removed, leaving only the `speeds` fields. Same thing with `ping` and `speeds>latency/jitter` duplication. * Setting a ping/speedtest interval of 0 will turn the respective test off * By default only failed tests will be printed to stdout/stderr, this can be controlled through `SPEEDTEST_DEBUG` diff --git a/main.py b/main.py index a889ab0..acb5cf2 100755 --- a/main.py +++ b/main.py @@ -94,14 +94,6 @@ def format_for_influx(data): # There is additional data in the speedtest-cli output but it is likely not necessary to store. influx_data = [ - { - "measurement": "ping", - "time": data["timestamp"], - "fields": { - "jitter": data["ping"]["jitter"], - "latency": data["ping"]["latency"], - }, - }, { "measurement": "packetLoss", "time": data["timestamp"], @@ -111,9 +103,9 @@ def format_for_influx(data): "measurement": "speeds", "time": data["timestamp"], "fields": { - "jitter": data["ping"]["jitter"], - "latency": data["ping"]["latency"], - "packetLoss": pkt_loss(data), + "ping_jitter": data["ping"]["jitter"], + "ping_latency": data["ping"]["latency"], + "packet_loss": pkt_loss(data), "bandwidth_down": data["download"]["bandwidth"], "bytes_down": data["download"]["bytes"], "elapsed_down": data["download"]["elapsed"], @@ -162,9 +154,9 @@ def speedtest(): + str(data_json["ping"]["latency"]) + " ms - download: " + str(data_json["download"]["bandwidth"]) - + " Mb/s - upload: " + + " b/s - upload: " + str(data_json["upload"]["bandwidth"]) - + " Mb/s - isp: " + + " b/s - isp: " + data_json["isp"] + " - ext. IP: " + data_json["interface"]["externalIp"]