app/vmselect/promql: rename removeNaNs() to more clear removeEmptySeries()

This commit is contained in:
Aliaksandr Valialkin 2022-04-20 19:53:24 +03:00
parent 1e0517b9cd
commit 0ef7a05fc0
No known key found for this signature in database
GPG key ID: A72BEC6CD3D0DED1
3 changed files with 6 additions and 6 deletions

View file

@ -619,7 +619,7 @@ func newAggrFuncTopK(isReverse bool) aggrFunc {
})
fillNaNsAtIdx(n, ks[n], tss)
}
tss = removeNaNs(tss)
tss = removeEmptySeries(tss)
reverseSeries(tss)
return tss
}
@ -686,7 +686,7 @@ func getRangeTopKTimeseries(tss []*timeseries, modifier *metricsql.ModifierExpr,
if remainingSumTS != nil {
tss = append(tss, remainingSumTS)
}
tss = removeNaNs(tss)
tss = removeEmptySeries(tss)
reverseSeries(tss)
return tss
}

View file

@ -322,7 +322,7 @@ func binaryOpAnd(bfa *binaryOpFuncArg) ([]*timeseries, error) {
}
}
}
tssLeft = removeNaNs(tssLeft)
tssLeft = removeEmptySeries(tssLeft)
rvs = append(rvs, tssLeft...)
}
return rvs, nil
@ -382,7 +382,7 @@ func binaryOpUnless(bfa *binaryOpFuncArg) ([]*timeseries, error) {
}
}
}
tssLeft = removeNaNs(tssLeft)
tssLeft = removeEmptySeries(tssLeft)
rvs = append(rvs, tssLeft...)
}
return rvs, nil

View file

@ -91,7 +91,7 @@ func maySortResults(e metricsql.Expr, tss []*timeseries) bool {
}
func timeseriesToResult(tss []*timeseries, maySort bool) ([]netstorage.Result, error) {
tss = removeNaNs(tss)
tss = removeEmptySeries(tss)
result := make([]netstorage.Result, len(tss))
m := make(map[string]struct{}, len(tss))
bb := bbPool.Get()
@ -144,7 +144,7 @@ func metricNameLess(a, b *storage.MetricName) bool {
return len(ats) < len(bts)
}
func removeNaNs(tss []*timeseries) []*timeseries {
func removeEmptySeries(tss []*timeseries) []*timeseries {
rvs := tss[:0]
for _, ts := range tss {
allNans := true