mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-11-21 14:44:00 +00:00
app/vmselect: drop rollupDefault
function as duplicate (#5502)
* app/vmselect: drop `rollupDefault` function as duplicate It is unclear why there are two identical fns `rollupDefault` and `rollupDistinct`. Dropping one of them. Signed-off-by: hagen1778 <roman@victoriametrics.com> * Update app/vmselect/promql/rollup.go * Update app/vmselect/promql/rollup.go --------- Signed-off-by: hagen1778 <roman@victoriametrics.com> Co-authored-by: Aliaksandr Valialkin <valyala@victoriametrics.com>
This commit is contained in:
parent
01f9edda64
commit
8c1dcf4743
1 changed files with 2 additions and 11 deletions
|
@ -2182,6 +2182,8 @@ func rollupFirst(rfa *rollupFuncArg) float64 {
|
|||
return values[0]
|
||||
}
|
||||
|
||||
var rollupLast = rollupDefault
|
||||
|
||||
func rollupDefault(rfa *rollupFuncArg) float64 {
|
||||
values := rfa.values
|
||||
if len(values) == 0 {
|
||||
|
@ -2195,17 +2197,6 @@ func rollupDefault(rfa *rollupFuncArg) float64 {
|
|||
return values[len(values)-1]
|
||||
}
|
||||
|
||||
func rollupLast(rfa *rollupFuncArg) float64 {
|
||||
values := rfa.values
|
||||
if len(values) == 0 {
|
||||
// Do not take into account rfa.prevValue, since it may lead
|
||||
// to inconsistent results comparing to Prometheus on broken time series
|
||||
// with irregular data points.
|
||||
return nan
|
||||
}
|
||||
return values[len(values)-1]
|
||||
}
|
||||
|
||||
func rollupDistinct(rfa *rollupFuncArg) float64 {
|
||||
// There is no need in handling NaNs here, since they must be cleaned up
|
||||
// before calling rollup funcs.
|
||||
|
|
Loading…
Reference in a new issue