Fix false alert when alert duration less than metric step
This commit is contained in:
parent
9015460c02
commit
2c45f9585d
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue