app/vmselect/promql: return the correct time series from quantile

Previously arbitrary time series could be returned from `quantile`
depending on sort order for the last data point in the selected range.

Fix this by returning the calculated time series.

Fixes https://github.com/VictoriaMetrics/VictoriaMetrics/issues/55
This commit is contained in:
Aliaksandr Valialkin 2019-06-06 17:07:28 +03:00
parent 5a5ba749f2
commit 1458450dba

View file

@ -457,6 +457,7 @@ func newAggrQuantileFunc(phis []float64) func(tss []*timeseries) []*timeseries {
idx := int(math.Round(float64(len(tss)-1) * phi))
dst.Values[n] = tss[idx].Values[n]
}
tss[0] = dst
return tss[:1]
}
}