dummie_executor.go 423 B

12345678910111213141516171819
  1. package alerting
  2. import (
  3. "github.com/grafana/grafana/pkg/log"
  4. m "github.com/grafana/grafana/pkg/models"
  5. "time"
  6. )
  7. type DummieExecutor struct{}
  8. func (this *DummieExecutor) Execute(rule m.AlertRule, responseQueue chan *AlertResult) {
  9. if rule.Id == 6 {
  10. time.Sleep(time.Second * 0)
  11. }
  12. //time.Sleep(time.Second)
  13. log.Info("Finnished executing: %d", rule.Id)
  14. responseQueue <- &AlertResult{State: "OK", Id: rule.Id}
  15. }