Revert "app/vmselect/promql: properly handle Prometheus staleness marks in removeCounterResets functions"

This reverts commit 94dfcb6747a3b29a11d14e71bea21a2312bb6346.

It is better to remove staleness marks (decimal.StaleNaN) before calling rollupConfig.Do, e.g. in preFunc
This commit is contained in:
Aliaksandr Valialkin 2021-08-15 12:56:35 +03:00
parent 73d7b568da
commit 25997a70f1

View file

@ -704,6 +704,8 @@ func getMaxPrevInterval(scrapeInterval int64) int64 {
} }
func removeCounterResets(values []float64) { func removeCounterResets(values []float64) {
// There is no need in handling NaNs here, since they are impossible
// on values from vmstorage.
if len(values) == 0 { if len(values) == 0 {
return return
} }
@ -721,11 +723,9 @@ func removeCounterResets(values []float64) {
} }
} }
prevValue = v prevValue = v
if !decimal.IsStaleNaN(v) {
values[i] = v + correction values[i] = v + correction
} }
} }
}
func deltaValues(values []float64) { func deltaValues(values []float64) {
// There is no need in handling NaNs here, since they are impossible // There is no need in handling NaNs here, since they are impossible