rules: Cleanup unused function alert.Duration (#6734)
The function HoldDuration and Duration did the exact same thing. Let's only keep HoldDuration() as Duration() is more confusing. Signed-off-by: Julien Pivotto <roidelapluie@inuits.eu>
This commit is contained in:
parent
bdcfebdf74
commit
0e912faf4f
|
@ -205,8 +205,8 @@ func (r *AlertingRule) Query() promql.Expr {
|
||||||
return r.vector
|
return r.vector
|
||||||
}
|
}
|
||||||
|
|
||||||
// Duration returns the hold duration of the alerting rule.
|
// HoldDuration returns the hold duration of the alerting rule.
|
||||||
func (r *AlertingRule) Duration() time.Duration {
|
func (r *AlertingRule) HoldDuration() time.Duration {
|
||||||
return r.holdDuration
|
return r.holdDuration
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -547,8 +547,3 @@ func (r *AlertingRule) HTMLSnippet(pathPrefix string) html_template.HTML {
|
||||||
}
|
}
|
||||||
return html_template.HTML(byt)
|
return html_template.HTML(byt)
|
||||||
}
|
}
|
||||||
|
|
||||||
// HoldDuration returns the holdDuration of the alerting rule.
|
|
||||||
func (r *AlertingRule) HoldDuration() time.Duration {
|
|
||||||
return r.holdDuration
|
|
||||||
}
|
|
||||||
|
|
|
@ -972,7 +972,7 @@ func (api *API) rules(r *http.Request) apiFuncResult {
|
||||||
State: rule.State().String(),
|
State: rule.State().String(),
|
||||||
Name: rule.Name(),
|
Name: rule.Name(),
|
||||||
Query: rule.Query().String(),
|
Query: rule.Query().String(),
|
||||||
Duration: rule.Duration().Seconds(),
|
Duration: rule.HoldDuration().Seconds(),
|
||||||
Labels: rule.Labels(),
|
Labels: rule.Labels(),
|
||||||
Annotations: rule.Annotations(),
|
Annotations: rule.Annotations(),
|
||||||
Alerts: rulesAlertsToAPIAlerts(rule.ActiveAlerts()),
|
Alerts: rulesAlertsToAPIAlerts(rule.ActiveAlerts()),
|
||||||
|
|
Loading…
Reference in New Issue