From 3e0c473cc9549ffd9ee2cbc7c3c3270dbc00150b Mon Sep 17 00:00:00 2001 From: Aliaksandr Valialkin Date: Fri, 2 Oct 2020 13:58:17 +0300 Subject: [PATCH] app/vmselect/promql: fill gaps on graphs for `range_*` and `running_*` functions Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/806 --- app/vmselect/promql/transform.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/app/vmselect/promql/transform.go b/app/vmselect/promql/transform.go index 65b7387769..b43638b13a 100644 --- a/app/vmselect/promql/transform.go +++ b/app/vmselect/promql/transform.go @@ -912,10 +912,9 @@ func newTransformFuncRunning(rf func(a, b float64, idx int) float64) transformFu prevValue := values[0] values = values[1:] for i, v := range values { - if math.IsNaN(v) { - continue + if !math.IsNaN(v) { + prevValue = rf(prevValue, v, i+1) } - prevValue = rf(prevValue, v, i+1) values[i] = prevValue } }