Rename "execution time" to "evaluation time". (#401)

Signed-off-by: Peter Štibraný <pstibrany@gmail.com>
This commit is contained in:
Peter Štibraný 2023-01-19 16:11:44 +01:00 committed by GitHub
parent 806e71e828
commit 44904a663c
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 66 additions and 66 deletions

View file

@ -141,7 +141,7 @@ type RuleGroup struct {
Limit int `yaml:"limit,omitempty"`
Rules []RuleNode `yaml:"rules"`
SourceTenants []string `yaml:"source_tenants,omitempty"`
AlignExecutionTimeOnInterval bool `yaml:"align_execution_time_on_interval,omitempty"`
AlignEvaluationTimeOnInterval bool `yaml:"align_evaluation_time_on_interval,omitempty"`
}
// Rule describes an alerting or recording rule.

View file

@ -1,13 +1,13 @@
groups:
- name: aligned
align_execution_time_on_interval: true
align_evaluation_time_on_interval: true
interval: 5m
rules:
- record: job:http_requests:rate5m
expr: sum by (job)(rate(http_requests_total[5m]))
- name: aligned_with_crazy_interval
align_execution_time_on_interval: true
align_evaluation_time_on_interval: true
interval: 1m27s
rules:
- record: job:http_requests:rate5m
@ -21,7 +21,7 @@ groups:
- name: unaligned_explicit
interval: 5m
align_execution_time_on_interval: false
align_evaluation_time_on_interval: false
rules:
- record: job:http_requests:rate5m
expr: sum by (job)(rate(http_requests_total[5m]))

View file

@ -271,7 +271,7 @@ type Group struct {
metrics *Metrics
ruleGroupPostProcessFunc RuleGroupPostProcessFunc
alignExecutionTimeOnInterval bool
alignEvaluationTimeOnInterval bool
}
// This function will be used before each rule group evaluation if not nil.
@ -289,7 +289,7 @@ type GroupOptions struct {
EvaluationDelay *time.Duration
done chan struct{}
RuleGroupPostProcessFunc RuleGroupPostProcessFunc
AlignExecutionTimeOnInterval bool
AlignEvaluationTimeOnInterval bool
}
// NewGroup makes a new Group with the given name, options, and rules.
@ -327,7 +327,7 @@ func NewGroup(o GroupOptions) *Group {
logger: log.With(o.Opts.Logger, "file", o.File, "group", o.Name),
metrics: metrics,
ruleGroupPostProcessFunc: o.RuleGroupPostProcessFunc,
alignExecutionTimeOnInterval: o.AlignExecutionTimeOnInterval,
alignEvaluationTimeOnInterval: o.AlignEvaluationTimeOnInterval,
}
}
@ -551,7 +551,7 @@ func (g *Group) setLastEvaluation(ts time.Time) {
// EvalTimestamp returns the immediately preceding consistently slotted evaluation time.
func (g *Group) EvalTimestamp(startTime int64) time.Time {
var offset int64
if !g.alignExecutionTimeOnInterval {
if !g.alignEvaluationTimeOnInterval {
offset = int64(g.hash() % uint64(g.interval))
}
@ -933,7 +933,7 @@ func (g *Group) Equals(ng *Group) bool {
return false
}
if g.alignExecutionTimeOnInterval != ng.alignExecutionTimeOnInterval {
if g.alignEvaluationTimeOnInterval != ng.alignEvaluationTimeOnInterval {
return false
}
@ -1216,7 +1216,7 @@ func (m *Manager) LoadGroups(
EvaluationDelay: (*time.Duration)(rg.EvaluationDelay),
done: m.done,
RuleGroupPostProcessFunc: ruleGroupPostProcessFunc,
AlignExecutionTimeOnInterval: rg.AlignExecutionTimeOnInterval,
AlignEvaluationTimeOnInterval: rg.AlignEvaluationTimeOnInterval,
})
}
}

View file

@ -1045,7 +1045,7 @@ type ruleGroupTest struct {
Limit int `yaml:"limit,omitempty"`
Rules []rulefmt.Rule `yaml:"rules"`
SourceTenants []string `yaml:"source_tenants,omitempty"`
AlignExecutionTimeOnInterval bool `yaml:"align_execution_time_on_interval,omitempty"`
AlignEvaluationTimeOnInterval bool `yaml:"align_evaluation_time_on_interval,omitempty"`
}
func formatRules(r *rulefmt.RuleGroups) ruleGroupsTest {
@ -1069,7 +1069,7 @@ func formatRules(r *rulefmt.RuleGroups) ruleGroupsTest {
Limit: g.Limit,
Rules: rtmp,
SourceTenants: g.SourceTenants,
AlignExecutionTimeOnInterval: g.AlignExecutionTimeOnInterval,
AlignEvaluationTimeOnInterval: g.AlignEvaluationTimeOnInterval,
})
}
return ruleGroupsTest{