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 (
|
var (
|
||||||
VALID_STATES = []string{
|
VALID_STATES = []string{
|
||||||
ALERT_STATE_OK,
|
AlertStateOk,
|
||||||
ALERT_STATE_WARN,
|
AlertStateWarn,
|
||||||
ALERT_STATE_CRITICAL,
|
AlertStateCritical,
|
||||||
ALERT_STATE_ACKNOWLEDGED,
|
AlertStateAcknowledged,
|
||||||
ALERT_STATE_MAINTENANCE,
|
AlertStateMaintenance,
|
||||||
}
|
}
|
||||||
|
|
||||||
ALERT_STATE_OK = "OK"
|
AlertStateOk = "OK"
|
||||||
ALERT_STATE_WARN = "WARN"
|
AlertStateWarn = "WARN"
|
||||||
ALERT_STATE_CRITICAL = "CRITICAL"
|
AlertStateCritical = "CRITICAL"
|
||||||
ALERT_STATE_ACKNOWLEDGED = "ACKNOWLEDGED"
|
AlertStateAcknowledged = "ACKNOWLEDGED"
|
||||||
ALERT_STATE_MAINTENANCE = "MAINTENANCE"
|
AlertStateMaintenance = "MAINTENANCE"
|
||||||
)
|
)
|
||||||
|
|
||||||
func (this *UpdateAlertStateCommand) IsValidState() bool {
|
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))
|
avg = sum / float64(len(v.Datapoints))
|
||||||
|
|
||||||
if float64(rule.CritLevel) < avg {
|
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 {
|
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 {
|
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 {
|
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) {
|
func (this *GraphiteExecutor) getSeries(rule m.AlertRule) (Response, error) {
|
||||||
|
Loading…
Reference in New Issue
Block a user