models.go 808 B

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. package alerting
  2. import "github.com/grafana/grafana/pkg/services/alerting/alertstates"
  3. type AlertJob struct {
  4. Offset int64
  5. Delay bool
  6. Running bool
  7. RetryCount int
  8. Rule *AlertRule
  9. }
  10. type AlertResult struct {
  11. Id int64
  12. State string
  13. ActualValue float64
  14. Duration float64
  15. Description string
  16. AlertJob *AlertJob
  17. }
  18. func (ar *AlertResult) IsResultIncomplete() bool {
  19. return ar.State == alertstates.Pending
  20. }
  21. type AlertRule struct {
  22. Id int64
  23. OrgId int64
  24. DatasourceId int64
  25. DashboardId int64
  26. PanelId int64
  27. Query string
  28. QueryRefId string
  29. WarnLevel float64
  30. CritLevel float64
  31. WarnOperator string
  32. CritOperator string
  33. Frequency int64
  34. Title string
  35. Description string
  36. QueryRange int
  37. Aggregator string
  38. }