StatusAt returns the status of the alert at the given timestamp.
(ts time.Time)
| 81 | |
| 82 | // StatusAt returns the status of the alert at the given timestamp. |
| 83 | func (a *Alert) StatusAt(ts time.Time) AlertStatus { |
| 84 | if a.ResolvedAt(ts) { |
| 85 | return AlertResolved |
| 86 | } |
| 87 | return AlertFiring |
| 88 | } |
| 89 | |
| 90 | // Validate checks whether the alert data is inconsistent. |
| 91 | func (a *Alert) Validate() error { |