grafana/pkg/services/alerting/interfaces.go
2016-07-20 14:28:02 +02:00

33 lines
593 B
Go

package alerting
import (
"time"
"github.com/grafana/grafana/pkg/tsdb"
)
type AlertHandler interface {
Execute(rule *AlertRule, resultChan chan *AlertResultContext)
}
type Scheduler interface {
Tick(time time.Time, execQueue chan *AlertJob)
Update(rules []*AlertRule)
}
type Notifier interface {
Notify(alertResult *AlertResultContext)
}
type AlertCondition interface {
Eval(result *AlertResultContext)
}
type QueryReducer interface {
Reduce(timeSeries *tsdb.TimeSeries) float64
}
type AlertEvaluator interface {
Eval(timeSeries *tsdb.TimeSeries, reducedValue float64) bool
}