提交 2c45f958 编写于 作者: 7 710leo

Fix false alert when alert duration less than metric step

上级 9015460c
......@@ -177,7 +177,13 @@ func judgeItemWithStrategy(stra *model.Stra, historyData []*dataobj.HistoryData,
logger.Errorf("wrong step:%+v", firstItem)
return
}
straParam = append(straParam, stra.AlertDur/int(firstItem.Step))
limit := stra.AlertDur / int(firstItem.Step)
if limit <= 0 {
limit = 1
}
straParam = append(straParam, limit)
switch straFunc {
case "happen":
......
......@@ -25,7 +25,7 @@ func (j *Judge) Send(items []*dataobj.JudgeItem, resp *dataobj.SimpleRpcResponse
logger.Debug("recv-->", item)
stats.Counter.Set("push.in", 1)
judge.ToJudge(cache.HistoryBigMap[pk[0:2]], pk, item, now)
go judge.ToJudge(cache.HistoryBigMap[pk[0:2]], pk, item, now)
}
return nil
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册