mirror of
https://github.com/LibreQoE/LibreQoS.git
synced 2025-02-25 18:55:32 -06:00
Add the ability to graph median latency of the entire network
This commit is contained in:
parent
96e1e1b3e5
commit
8fc2fdd01a
@ -507,11 +507,19 @@ def refreshLatencyGraphs():
|
|||||||
tcpLatency = float(parentNode['stats']['sinceLastQuery']['tcpLatency'])
|
tcpLatency = float(parentNode['stats']['sinceLastQuery']['tcpLatency'])
|
||||||
p = Point('TCP Latency').tag("Device", parentNode['parentNodeName']).tag("ParentNode", parentNode['parentNodeName']).tag("Type", "Parent Node").field("TCP Latency", tcpLatency)
|
p = Point('TCP Latency').tag("Device", parentNode['parentNodeName']).tag("ParentNode", parentNode['parentNodeName']).tag("Type", "Parent Node").field("TCP Latency", tcpLatency)
|
||||||
queriesToSend.append(p)
|
queriesToSend.append(p)
|
||||||
|
|
||||||
write_api.write(bucket=influxDBBucket, record=queriesToSend)
|
write_api.write(bucket=influxDBBucket, record=queriesToSend)
|
||||||
# print("Added " + str(len(queriesToSend)) + " points to InfluxDB.")
|
|
||||||
queriesToSendCount += len(queriesToSend)
|
queriesToSendCount += len(queriesToSend)
|
||||||
|
|
||||||
|
listOfAllLatencies = []
|
||||||
|
for circuit in subscriberCircuits:
|
||||||
|
if circuit['stats']['sinceLastQuery']['tcpLatency'] != None:
|
||||||
|
listOfAllLatencies.append(circuit['stats']['sinceLastQuery']['tcpLatency'])
|
||||||
|
currentNetworkLatency = statistics.median(listOfAllLatencies)
|
||||||
|
p = Point('TCP Latency').tag("Type", "Network").field("TCP Latency", currentNetworkLatency)
|
||||||
|
write_api.write(bucket=influxDBBucket, record=p)
|
||||||
|
queriesToSendCount += 1
|
||||||
|
|
||||||
print("Added " + str(queriesToSendCount) + " points to InfluxDB.")
|
print("Added " + str(queriesToSendCount) + " points to InfluxDB.")
|
||||||
|
|
||||||
client.close()
|
client.close()
|
||||||
|
Loading…
Reference in New Issue
Block a user