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) fillNaNsAtIdx(n, ks[n], tss)
} }
tss = removeNaNs(tss) tss = removeEmptySeries(tss)
reverseSeries(tss) reverseSeries(tss)
return tss return tss
} }
@ -686,7 +686,7 @@ func getRangeTopKTimeseries(tss []*timeseries, modifier *metricsql.ModifierExpr,
if remainingSumTS != nil { if remainingSumTS != nil {
tss = append(tss, remainingSumTS) tss = append(tss, remainingSumTS)
} }
tss = removeNaNs(tss) tss = removeEmptySeries(tss)
reverseSeries(tss) reverseSeries(tss)
return 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...) rvs = append(rvs, tssLeft...)
} }
return rvs, nil return rvs, nil
@ -382,7 +382,7 @@ func binaryOpUnless(bfa *binaryOpFuncArg) ([]*timeseries, error) {
} }
} }
} }
tssLeft = removeNaNs(tssLeft) tssLeft = removeEmptySeries(tssLeft)
rvs = append(rvs, tssLeft...) rvs = append(rvs, tssLeft...)
} }
return rvs, nil 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) { func timeseriesToResult(tss []*timeseries, maySort bool) ([]netstorage.Result, error) {
tss = removeNaNs(tss) tss = removeEmptySeries(tss)
result := make([]netstorage.Result, len(tss)) result := make([]netstorage.Result, len(tss))
m := make(map[string]struct{}, len(tss)) m := make(map[string]struct{}, len(tss))
bb := bbPool.Get() bb := bbPool.Get()
@ -144,7 +144,7 @@ func metricNameLess(a, b *storage.MetricName) bool {
return len(ats) < len(bts) return len(ats) < len(bts)
} }
func removeNaNs(tss []*timeseries) []*timeseries { func removeEmptySeries(tss []*timeseries) []*timeseries {
rvs := tss[:0] rvs := tss[:0]
for _, ts := range tss { for _, ts := range tss {
allNans := true allNans := true