mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
feat(alerting): disable visual thresholds while alert is enabled
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user