Просмотр исходного кода

feat(alerting): add interface for alert backend

bergquist 9 лет назад
Родитель
Сommit
0bea0cc5b9
1 измененных файлов с 7 добавлено и 0 удалено
  1. 7 0
      pkg/services/alerting/datasources/backends.go

+ 7 - 0
pkg/services/alerting/datasources/backends.go

@@ -2,9 +2,16 @@ package graphite
 
 import (
 	"fmt"
+
 	m "github.com/grafana/grafana/pkg/models"
 )
 
+// AlertDatasource is bacon
+type AlertDatasource interface {
+	GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error)
+}
+
+// GetSeries returns timeseries data from the datasource
 func GetSeries(job *m.AlertJob) (m.TimeSeriesSlice, error) {
 	if job.Datasource.Type == m.DS_GRAPHITE {
 		return GraphiteClient{}.GetSeries(job)