eh
This commit is contained in:
parent
f5edd93ee1
commit
8465bf92df
@ -30,17 +30,17 @@ class ReportView(FlaskView):
|
||||
|
||||
@route("/link", methods=['GET'])
|
||||
def link_get(self):
|
||||
q = influxdb_instance.connection.query_api()
|
||||
response = {}
|
||||
|
||||
# Query latency
|
||||
|
||||
latency_tables = q.query(f"""from(bucket: "alma")
|
||||
query = """from(bucket: "alma")
|
||||
|> range(start: -2m, stop: now())
|
||||
|> filter(fn: (r) => r["_measurement"] == "link_latency")
|
||||
|> timedMovingAverage(every: 30s, period: 1m)
|
||||
|> last()
|
||||
|> yield()""")
|
||||
|> yield()"""
|
||||
latency_tables = influxdb_instance.query_api(query)
|
||||
|
||||
for table in latency_tables:
|
||||
for value in table.values:
|
||||
@ -52,12 +52,13 @@ class ReportView(FlaskView):
|
||||
|
||||
# Query rate
|
||||
|
||||
rate_tables = q.query(f"""from(bucket: "alma")
|
||||
query = """from(bucket: "alma")
|
||||
|> range(start: -2m, stop: now())
|
||||
|> filter(fn: (r) => r["_measurement"] == "link_rate")
|
||||
|> timedMovingAverage(every: 30s, period: 1m)
|
||||
|> last()
|
||||
|> yield()""")
|
||||
|> yield()"""
|
||||
rate_tables = influxdb_instance.query_api(query)
|
||||
|
||||
for table in rate_tables:
|
||||
for value in table.values:
|
||||
@ -91,19 +92,19 @@ class ReportView(FlaskView):
|
||||
|
||||
@route("/client", methods=['GET'])
|
||||
def client_get(self):
|
||||
q = influxdb_instance.connection.query_api()
|
||||
response = {}
|
||||
|
||||
# Query queue
|
||||
|
||||
latency_tables = q.query(f"""from(bucket: "alma")
|
||||
query = """from(bucket: "alma")
|
||||
|> range(start: -2m, stop: now())
|
||||
|> filter(fn: (r) => r["_measurement"] == "client_queue")
|
||||
|> timedMovingAverage(every: 30s, period: 1m)
|
||||
|> last()
|
||||
|> yield()""")
|
||||
|> yield()"""
|
||||
queue_tables = influxdb_instance.query_api(query)
|
||||
|
||||
for table in latency_tables:
|
||||
for table in queue_tables:
|
||||
for value in table.values:
|
||||
key = value['client']
|
||||
if key in response:
|
||||
@ -140,14 +141,15 @@ class ReportView(FlaskView):
|
||||
|
||||
# Query queue
|
||||
|
||||
latency_tables = q.query(f"""from(bucket: "alma")
|
||||
query = """from(bucket: "alma")
|
||||
|> range(start: -2m, stop: now())
|
||||
|> filter(fn: (r) => r["_measurement"] == "site_queue")
|
||||
|> timedMovingAverage(every: 30s, period: 1m)
|
||||
|> last()
|
||||
|> yield()""")
|
||||
|> yield()"""
|
||||
queue_tables = influxdb_instance.query_api(query)
|
||||
|
||||
for table in latency_tables:
|
||||
for table in queue_tables:
|
||||
for value in table.values:
|
||||
key = value['site']
|
||||
if key in response:
|
||||
|
Loading…
Reference in New Issue
Block a user