Commit 5f5fab00 by 陈森彬

update

parent 63fb0308
Showing with 3 additions and 2 deletions
...@@ -67,8 +67,9 @@ def get_error_ratio(task_code, time_range=30): ...@@ -67,8 +67,9 @@ def get_error_ratio(task_code, time_range=30):
res = requests.post(url,json=query) res = requests.post(url,json=query)
# value = response['aggregations']['avgFailRate']['value'] # value = response['aggregations']['avgFailRate']['value']
value = res.json()['aggregations']['avgFailRate']['value'] if res.status_code==200 else 0.0 print(task_code)
print(task_code,value) value = res.json()['aggregations']['avgFailRate']['value'] if res.status_code==200 and res.json()['aggregations']['avgFailRate']['value'] else 0.0
print(value)
print(res.json()) print(res.json())
return round(value, 3) return round(value, 3)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment