Private GIT

Skip to content
Snippets Groups Projects
Commit 1ef2c6e9 authored by breadlysm's avatar breadlysm
Browse files

removed bit conversions, forced packet loss to int

parent ec879c70
Branches
No related tags found
No related merge requests found
...@@ -47,7 +47,7 @@ def format_for_influx(cliout): ...@@ -47,7 +47,7 @@ def format_for_influx(cliout):
'time': data['timestamp'], 'time': data['timestamp'],
'fields': { 'fields': {
# Byte to Megabit # Byte to Megabit
'bandwidth': data['download']['bandwidth'] / 125000, 'bandwidth': data['download']['bandwidth'], #/125000
'bytes': data['download']['bytes'], 'bytes': data['download']['bytes'],
'elapsed': data['download']['elapsed'] 'elapsed': data['download']['elapsed']
} }
...@@ -57,7 +57,7 @@ def format_for_influx(cliout): ...@@ -57,7 +57,7 @@ def format_for_influx(cliout):
'time': data['timestamp'], 'time': data['timestamp'],
'fields': { 'fields': {
# Byte to Megabit # Byte to Megabit
'bandwidth': data['upload']['bandwidth'] / 125000, 'bandwidth': data['upload']['bandwidth'], #/125000
'bytes': data['upload']['bytes'], 'bytes': data['upload']['bytes'],
'elapsed': data['upload']['elapsed'] 'elapsed': data['upload']['elapsed']
} }
...@@ -66,7 +66,7 @@ def format_for_influx(cliout): ...@@ -66,7 +66,7 @@ def format_for_influx(cliout):
'measurement': 'packetLoss', 'measurement': 'packetLoss',
'time': data['timestamp'], 'time': data['timestamp'],
'fields': { 'fields': {
'packetLoss': data['packetLoss'] 'packetLoss': int(data['packetLoss'])
} }
} }
] ]
...@@ -81,6 +81,7 @@ def main(): ...@@ -81,6 +81,7 @@ def main():
speedtest = subprocess.run( speedtest = subprocess.run(
["speedtest", "--accept-license", "--accept-gdpr", "-f", "json"], capture_output=True) ["speedtest", "--accept-license", "--accept-gdpr", "-f", "json"], capture_output=True)
if speedtest.returncode == 0: # Speedtest was successful.
if speedtest.returncode == 0: # Speedtest was successful. if speedtest.returncode == 0: # Speedtest was successful.
data = format_for_influx(speedtest.stdout) data = format_for_influx(speedtest.stdout)
print("Speedtest Successful:") print("Speedtest Successful:")
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment