app/vmselect/promql: fill gaps on graphs for range_* and running_* functions

Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/806
This commit is contained in:
Aliaksandr Valialkin 2020-10-02 13:58:17 +03:00
parent fd7dd5064a
commit 3e0c473cc9

View file

@ -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
}
}