This commit is contained in:
parent
7809e968f4
commit
ac0c8f999e
@ -43,12 +43,12 @@ class ReportView(FlaskView):
|
||||
latency_tables = influxdb_instance.query_api.query(query)
|
||||
|
||||
for table in latency_tables:
|
||||
for value in table.values:
|
||||
key = value['client'] + ":" + value['site']
|
||||
for row in table.records:
|
||||
key = row.values['client'] + ":" + row.values['site']
|
||||
if key in response:
|
||||
response[key]['latency'] = value['_value']
|
||||
response[key]['latency'] = row.values['_value']
|
||||
else:
|
||||
response[key] = {'latency': value['_value']}
|
||||
response[key] = {'latency': row.values['_value']}
|
||||
|
||||
# Query rate
|
||||
|
||||
@ -61,12 +61,12 @@ class ReportView(FlaskView):
|
||||
rate_tables = influxdb_instance.query_api.query(query)
|
||||
|
||||
for table in rate_tables:
|
||||
for value in table.values:
|
||||
key = value['client'] + ":" + value['site']
|
||||
for row in table.records
|
||||
key = row.values['client'] + ":" + row.values['site']
|
||||
if key in response:
|
||||
response[key]['rate'] = value['_value']
|
||||
response[key]['rate'] = row.values['_value']
|
||||
else:
|
||||
response[key] = {'rate': value['_value']}
|
||||
response[key] = {'rate': row.values['_value']}
|
||||
|
||||
return jsonify(response)
|
||||
|
||||
@ -105,12 +105,12 @@ class ReportView(FlaskView):
|
||||
queue_tables = influxdb_instance.query_api.query(query)
|
||||
|
||||
for table in queue_tables:
|
||||
for value in table.values:
|
||||
key = value['client']
|
||||
for row in table.records:
|
||||
key = row.values['client']
|
||||
if key in response:
|
||||
response[key]['queue'] = value['_value']
|
||||
response[key]['queue'] = row.values['_value']
|
||||
else:
|
||||
response[key] = {'queue': value['_value']}
|
||||
response[key] = {'queue': row.values['_value']}
|
||||
|
||||
return jsonify(response)
|
||||
|
||||
@ -149,11 +149,11 @@ class ReportView(FlaskView):
|
||||
queue_tables = influxdb_instance.query_api.query(query)
|
||||
|
||||
for table in queue_tables:
|
||||
for value in table.values:
|
||||
key = value['site']
|
||||
for row in table.records:
|
||||
key = row.values['site']
|
||||
if key in response:
|
||||
response[key]['queue'] = value['_value']
|
||||
response[key]['queue'] = row.values['_value']
|
||||
else:
|
||||
response[key] = {'queue': value['_value']}
|
||||
response[key] = {'queue': row.values['_value']}
|
||||
|
||||
return jsonify(response)
|
||||
|
Loading…
Reference in New Issue
Block a user