Address too much ratio alerts generated after host deserialization

This commit is contained in:
emanuele-f 2019-08-27 11:02:28 +02:00
parent 57e623da04
commit eb3542d7e7
2 changed files with 27 additions and 13 deletions

View file

@ -37,8 +37,11 @@ local function request_reply_ratio(params)
for key, values in pairs(to_check) do
local to_check_key = check_module.key .. "__" .. key
local requests = alerts_api.host_delta_val(to_check_key .. "_requests", params.granularity, values[1])
local replies = alerts_api.host_delta_val(to_check_key .. "_replies", params.granularity, values[2])
-- true to avoid generating an alert due to a value just restored from redis
local skip_first = true
local requests = alerts_api.host_delta_val(to_check_key .. "_requests", params.granularity, values[1], skip_first)
local replies = alerts_api.host_delta_val(to_check_key .. "_replies", params.granularity, values[2], skip_first)
local ratio = (replies * 100) / (requests+1)
local req_repl_type = alerts_api.requestReplyRatioType(key, requests, replies, params.granularity)