mirror of
https://github.com/VictoriaMetrics/VictoriaMetrics.git
synced 2024-12-15 00:13:30 +01:00
app/vmselect/promql: an attempt to improve heuristics for dropping trailing data points in time series
Now trailing data points are additionally dropped for time series with a single raw sample Updates https://github.com/VictoriaMetrics/VictoriaMetrics/issues/748
This commit is contained in:
parent
efb1989193
commit
ee2902ddaf
@ -519,9 +519,10 @@ func (rc *rollupConfig) doInternal(dstValues []float64, tsm *timeseriesMap, valu
|
|||||||
}
|
}
|
||||||
rfa.values = values[i:j]
|
rfa.values = values[i:j]
|
||||||
rfa.timestamps = timestamps[i:j]
|
rfa.timestamps = timestamps[i:j]
|
||||||
if j == len(timestamps) && i < j && tEnd-timestamps[j-1] > stalenessInterval {
|
if j == len(timestamps) && j > 0 && (tEnd-timestamps[j-1] > stalenessInterval || i == j && len(timestamps) == 1) {
|
||||||
// Do not take into account the last data point in time series if the distance between this data point
|
// Drop trailing data points in the following cases:
|
||||||
// and tEnd exceeds stalenessInterval.
|
// - if the distance between the last raw sample and tEnd exceeds stalenessInterval
|
||||||
|
// - if time series contains only a single raw sample
|
||||||
// This should prevent from double counting when a label changes in time series (for instance,
|
// This should prevent from double counting when a label changes in time series (for instance,
|
||||||
// during new deployment in K8S). See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/748
|
// during new deployment in K8S). See https://github.com/VictoriaMetrics/VictoriaMetrics/issues/748
|
||||||
rfa.prevValue = nan
|
rfa.prevValue = nan
|
||||||
|
Loading…
Reference in New Issue
Block a user