fix: 修复因采样不足导致的告警
Some checks are pending
CodeQL / Analyze (go) (push) Waiting to run
CodeQL / Analyze (javascript) (push) Waiting to run
Contributors / contributors (push) Waiting to run
Sync / sync-to-jihulab (push) Waiting to run
Run Tests / tests (macos) (push) Waiting to run
Run Tests / tests (ubuntu) (push) Waiting to run
Run Tests / tests (windows) (push) Waiting to run

This commit is contained in:
naiba 2024-12-28 00:29:58 +08:00
parent 09b570aa3e
commit 8554f3eba7

View File

@ -98,6 +98,8 @@ func (r *AlertRule) Check(points [][]bool) (maxDuration int, passed bool) {
continue
}
if len(points) < duration {
// 如果采样点数量不足 则认为检查通过
hasPassedRule = true
continue
}
total, fail := 0.0, 0.0