mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
style(alerting): change const names
This commit is contained in:
parent
957cb407c5
commit
8ac635b631
@ -15,18 +15,18 @@ type AlertState struct {
|
||||
|
||||
var (
|
||||
VALID_STATES = []string{
|
||||
ALERT_STATE_OK,
|
||||
ALERT_STATE_WARN,
|
||||
ALERT_STATE_CRITICAL,
|
||||
ALERT_STATE_ACKNOWLEDGED,
|
||||
ALERT_STATE_MAINTENANCE,
|
||||
AlertStateOk,
|
||||
AlertStateWarn,
|
||||
AlertStateCritical,
|
||||
AlertStateAcknowledged,
|
||||
AlertStateMaintenance,
|
||||
}
|
||||
|
||||
ALERT_STATE_OK = "OK"
|
||||
ALERT_STATE_WARN = "WARN"
|
||||
ALERT_STATE_CRITICAL = "CRITICAL"
|
||||
ALERT_STATE_ACKNOWLEDGED = "ACKNOWLEDGED"
|
||||
ALERT_STATE_MAINTENANCE = "MAINTENANCE"
|
||||
AlertStateOk = "OK"
|
||||
AlertStateWarn = "WARN"
|
||||
AlertStateCritical = "CRITICAL"
|
||||
AlertStateAcknowledged = "ACKNOWLEDGED"
|
||||
AlertStateMaintenance = "MAINTENANCE"
|
||||
)
|
||||
|
||||
func (this *UpdateAlertStateCommand) IsValidState() bool {
|
||||
|
@ -44,23 +44,23 @@ func (this *GraphiteExecutor) executeRules(series []Series, rule m.AlertRule) *A
|
||||
avg = sum / float64(len(v.Datapoints))
|
||||
|
||||
if float64(rule.CritLevel) < avg {
|
||||
return &AlertResult{State: m.ALERT_STATE_CRITICAL, Id: rule.Id, ActualValue: avg}
|
||||
return &AlertResult{State: m.AlertStateCritical, Id: rule.Id, ActualValue: avg}
|
||||
}
|
||||
|
||||
if float64(rule.WarnLevel) < avg {
|
||||
return &AlertResult{State: m.ALERT_STATE_WARN, Id: rule.Id, ActualValue: avg}
|
||||
return &AlertResult{State: m.AlertStateWarn, Id: rule.Id, ActualValue: avg}
|
||||
}
|
||||
|
||||
if float64(rule.CritLevel) < sum {
|
||||
return &AlertResult{State: m.ALERT_STATE_CRITICAL, Id: rule.Id, ActualValue: sum}
|
||||
return &AlertResult{State: m.AlertStateCritical, Id: rule.Id, ActualValue: sum}
|
||||
}
|
||||
|
||||
if float64(rule.WarnLevel) < sum {
|
||||
return &AlertResult{State: m.ALERT_STATE_WARN, Id: rule.Id, ActualValue: sum}
|
||||
return &AlertResult{State: m.AlertStateWarn, Id: rule.Id, ActualValue: sum}
|
||||
}
|
||||
}
|
||||
|
||||
return &AlertResult{State: m.ALERT_STATE_OK, Id: rule.Id}
|
||||
return &AlertResult{State: m.AlertStateOk, Id: rule.Id}
|
||||
}
|
||||
|
||||
func (this *GraphiteExecutor) getSeries(rule m.AlertRule) (Response, error) {
|
||||
|
Loading…
Reference in New Issue
Block a user