mirror of
https://github.com/prometheus/prometheus.git
synced 2026-06-08 16:12:16 -04:00
promql: Forget lastFH in HistogramStatsIterator after Seek
After an effective Seek, the lastFH isn't the lastFH anymore, so we should nil it out. In practice, this should only matter is sub-queries, because we are otherwise not interested in a counter reset of the first sample returned after a Seek. Sub-queries, on the other hand, always do their own counter reset detection. (For that, they would prefer to see the whole histogram, so that's another problem for another commit.) Signed-off-by: beorn7 <beorn@grafana.com>
This commit is contained in:
parent
5010bd4bb1
commit
0cef66b12a
1 changed files with 5 additions and 0 deletions
|
|
@ -61,6 +61,11 @@ func (hsi *HistogramStatsIterator) Next() chunkenc.ValueType {
|
|||
// Seek mostly relays to the underlying iterator, but changes a ValHistogram
|
||||
// return into a ValFloatHistogram return.
|
||||
func (hsi *HistogramStatsIterator) Seek(t int64) chunkenc.ValueType {
|
||||
// If the Seek is going to move the iterator, we have to forget the
|
||||
// lastFH.
|
||||
if t > hsi.AtT() {
|
||||
hsi.lastFH = nil
|
||||
}
|
||||
vt := hsi.Iterator.Seek(t)
|
||||
if vt == chunkenc.ValHistogram {
|
||||
return chunkenc.ValFloatHistogram
|
||||
|
|
|
|||
Loading…
Reference in a new issue