anyádba már
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pünkösd Marcell 2021-12-09 23:38:04 +01:00
parent 7809e968f4
commit ac0c8f999e

View File

@ -43,12 +43,12 @@ class ReportView(FlaskView):
latency_tables = influxdb_instance.query_api.query(query) latency_tables = influxdb_instance.query_api.query(query)
for table in latency_tables: for table in latency_tables:
for value in table.values: for row in table.records:
key = value['client'] + ":" + value['site'] key = row.values['client'] + ":" + row.values['site']
if key in response: if key in response:
response[key]['latency'] = value['_value'] response[key]['latency'] = row.values['_value']
else: else:
response[key] = {'latency': value['_value']} response[key] = {'latency': row.values['_value']}
# Query rate # Query rate
@ -61,12 +61,12 @@ class ReportView(FlaskView):
rate_tables = influxdb_instance.query_api.query(query) rate_tables = influxdb_instance.query_api.query(query)
for table in rate_tables: for table in rate_tables:
for value in table.values: for row in table.records
key = value['client'] + ":" + value['site'] key = row.values['client'] + ":" + row.values['site']
if key in response: if key in response:
response[key]['rate'] = value['_value'] response[key]['rate'] = row.values['_value']
else: else:
response[key] = {'rate': value['_value']} response[key] = {'rate': row.values['_value']}
return jsonify(response) return jsonify(response)
@ -105,12 +105,12 @@ class ReportView(FlaskView):
queue_tables = influxdb_instance.query_api.query(query) queue_tables = influxdb_instance.query_api.query(query)
for table in queue_tables: for table in queue_tables:
for value in table.values: for row in table.records:
key = value['client'] key = row.values['client']
if key in response: if key in response:
response[key]['queue'] = value['_value'] response[key]['queue'] = row.values['_value']
else: else:
response[key] = {'queue': value['_value']} response[key] = {'queue': row.values['_value']}
return jsonify(response) return jsonify(response)
@ -149,11 +149,11 @@ class ReportView(FlaskView):
queue_tables = influxdb_instance.query_api.query(query) queue_tables = influxdb_instance.query_api.query(query)
for table in queue_tables: for table in queue_tables:
for value in table.values: for row in table.records:
key = value['site'] key = row.values['site']
if key in response: if key in response:
response[key]['queue'] = value['_value'] response[key]['queue'] = row.values['_value']
else: else:
response[key] = {'queue': value['_value']} response[key] = {'queue': row.values['_value']}
return jsonify(response) return jsonify(response)