@@ -125,7 +125,7 @@ func (c *EvalContext) GetNewState() m.AlertStateType {
return ns
}
- since := time.Now().Sub(c.Rule.LastStateChange)
+ since := time.Since(c.Rule.LastStateChange)
if c.PrevAlertState == m.AlertStatePending && since > c.Rule.For {
return m.AlertStateAlerting
@@ -36,7 +36,6 @@ func TestGetStateFromEvalContext(t *testing.T) {
name string
expected models.AlertStateType
applyFn func(ec *EvalContext)
- focus bool
}{
{
name: "ok -> alerting",