Commit a5a2b9e3 by 陈森彬

update elk返回判断

parent 5f5fab00
Showing with 1 additions and 3 deletions
...@@ -67,10 +67,8 @@ def get_error_ratio(task_code, time_range=30): ...@@ -67,10 +67,8 @@ 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']
print(task_code)
value = res.json()['aggregations']['avgFailRate']['value'] if res.status_code==200 and res.json()['aggregations']['avgFailRate']['value'] else 0.0 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())
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