From 0ef7a05fc0ad8bbe7a15cfe1669f7b15348f09ce Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Wed, 20 Apr 2022 19:53:24 +0300 Subject: [PATCH] app/vmselect/promql: rename removeNaNs() to more clear removeEmptySeries() --- app/vmselect/promql/aggr.go | 4 ++-- app/vmselect/promql/binary_op.go | 4 ++-- app/vmselect/promql/exec.go | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/vmselect/promql/aggr.go b/app/vmselect/promql/aggr.go index e2b435c1c5..c4927a16cb 100644 --- a/app/vmselect/promql/aggr.go +++ b/app/vmselect/promql/aggr.go @@ -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 } diff --git a/app/vmselect/promql/binary_op.go b/app/vmselect/promql/binary_op.go index b720573d51..7c04a20847 100644 --- a/app/vmselect/promql/binary_op.go +++ b/app/vmselect/promql/binary_op.go @@ -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 diff --git a/app/vmselect/promql/exec.go b/app/vmselect/promql/exec.go index f4023a36aa..fc2f939e24 100644 --- a/app/vmselect/promql/exec.go +++ b/app/vmselect/promql/exec.go @@ -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