Aggr lanteness (#611)

* aggr lateness

* default value

* test

* test

Co-authored-by: alickliming <alickliming@didiglobal.com>
This commit is contained in:
alick-liming 2021-03-12 15:10:42 +08:00 committed by GitHub
parent 398628870c
commit 7a84223d5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -18,6 +18,7 @@ import (
type AggrSection struct {
Enabled bool `yaml:"enabled"`
Lateness int `yaml:"lateness"`
ApiPath string `yaml:"apiPath"`
ApiTimeout int `yaml:"apiTimeout"`
UpdateInterval int `yaml:"updateInterval"`
@ -131,6 +132,11 @@ func transPoints(item *dataobj.MetricValue, strategys []*dataobj.RawMetricAggrCa
result.Hash = murmur3.Sum64([]byte(hash)) / 2
lateness := AggrConfig.Lateness
if lateness == 0 {
lateness = 60
}
for _, rule := range strategys {
ruleValid := true
@ -155,8 +161,6 @@ func transPoints(item *dataobj.MetricValue, strategys []*dataobj.RawMetricAggrCa
step = int(item.Step) // 如果没有指定step则默认和point的step相同
}
lateness := step * 3
result.Strategys = append(result.Strategys, &dataobj.AggrCalcStra{
SID: rule.Sid,
NID: strconv.FormatInt(rule.Nid, 10),