feat(alerting): disable visual thresholds while alert is enabled

This commit is contained in:
Torkel Ödegaard
2016-08-12 13:19:06 +02:00
parent 7242dc2ebe
commit 74dbd7fb36
10 changed files with 154 additions and 64 deletions

View File

@@ -19,9 +19,9 @@ type DefaultAlertEvaluator struct {
func (e *DefaultAlertEvaluator) Eval(series *tsdb.TimeSeries, reducedValue float64) bool {
switch e.Type {
case ">":
case "gt":
return reducedValue > e.Threshold
case "<":
case "lt":
return reducedValue < e.Threshold
}

View File

@@ -18,7 +18,7 @@ func TestQueryCondition(t *testing.T) {
queryConditionScenario("Given avg() and > 100", func(ctx *queryConditionTestContext) {
ctx.reducer = `{"type": "avg"}`
ctx.evaluator = `{"type": ">", "params": [100]}`
ctx.evaluator = `{"type": "gt "params": [100]}`
Convey("Can read query condition from json model", func() {
ctx.exec()