mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08:00
Fixups for single-op-per-fingerprint view rendering.
Change-Id: Ie496d4529b65a3819c6042f43d7cf99e0e1ac60b
This commit is contained in:
parent
8b43497002
commit
5745ce0a60
|
@ -15,6 +15,7 @@ package metric
|
|||
|
||||
import (
|
||||
"time"
|
||||
|
||||
"github.com/prometheus/prometheus/utility"
|
||||
|
||||
clientmodel "github.com/prometheus/client_golang/model"
|
||||
|
@ -93,6 +94,7 @@ func (l *valueAtTimeList) Get(fp *clientmodel.Fingerprint, time clientmodel.Time
|
|||
}
|
||||
op.fp = *fp
|
||||
op.current = time
|
||||
op.consumed = false
|
||||
return op
|
||||
}
|
||||
|
||||
|
|
|
@ -434,6 +434,7 @@ func (t *TieredStorage) renderView(viewJob viewJob) {
|
|||
|
||||
memValues := t.memoryArena.CloneSamples(fp)
|
||||
|
||||
for !op.Consumed() {
|
||||
// Abort the view rendering if the caller (MakeView) has timed out.
|
||||
if len(viewJob.abort) > 0 {
|
||||
return
|
||||
|
@ -504,7 +505,7 @@ func (t *TieredStorage) renderView(viewJob viewJob) {
|
|||
|
||||
// There's no data at all for this fingerprint, so stop processing.
|
||||
if len(currentChunk) == 0 {
|
||||
continue
|
||||
break
|
||||
}
|
||||
|
||||
currentChunk = currentChunk.TruncateBefore(targetTime)
|
||||
|
@ -514,12 +515,18 @@ func (t *TieredStorage) renderView(viewJob viewJob) {
|
|||
targetTime = lastChunkTime
|
||||
}
|
||||
|
||||
if op.CurrentTime().After(targetTime) {
|
||||
break
|
||||
}
|
||||
|
||||
// Extract all needed data from the current chunk and append the
|
||||
// extracted samples to the materialized view.
|
||||
for !op.Consumed() && !op.CurrentTime().After(targetTime) {
|
||||
view.appendSamples(fp, op.ExtractSamples(Values(currentChunk)))
|
||||
}
|
||||
}
|
||||
giveBackOp(op)
|
||||
}
|
||||
extractionTimer.Stop()
|
||||
|
||||
viewJob.output <- view
|
||||
|
|
Loading…
Reference in a new issue