Files
grafana/pkg/services/alerting/dummie_executor.go
T
2016-05-30 19:08:04 +02:00

21 lines
428 B
Go

package alerting
import (
"github.com/grafana/grafana/pkg/log"
m "github.com/grafana/grafana/pkg/models"
"time"
)
type DummieExecutor struct{}
func (this *DummieExecutor) Execute(rule m.AlertRule, responseQueue chan *m.AlertResult) {
if rule.Id%3 == 0 {
time.Sleep(time.Second * 1)
}
time.Sleep(time.Second)
log.Info("Finnished executing: %d", rule.Id)
responseQueue <- &m.AlertResult{State: "OK", Id: rule.Id}
}