mirror of
https://github.com/prometheus/prometheus.git
synced 2024-11-09 23:24:05 -08:00
tsdb: remove redundant fields. (#7869)
Signed-off-by: johncming <johncming@yahoo.com>
This commit is contained in:
parent
bd53b5ff37
commit
75ae384192
18
tsdb/head.go
18
tsdb/head.go
|
@ -1397,11 +1397,10 @@ func (h *Head) chunksRange(mint, maxt int64, is *isolationState) (*headChunkRead
|
|||
mint = hmin
|
||||
}
|
||||
return &headChunkReader{
|
||||
head: h,
|
||||
mint: mint,
|
||||
maxt: maxt,
|
||||
isoState: is,
|
||||
memChunkPool: &h.memChunkPool,
|
||||
head: h,
|
||||
mint: mint,
|
||||
maxt: maxt,
|
||||
isoState: is,
|
||||
}, nil
|
||||
}
|
||||
|
||||
|
@ -1456,10 +1455,9 @@ func (h *Head) Close() error {
|
|||
}
|
||||
|
||||
type headChunkReader struct {
|
||||
head *Head
|
||||
mint, maxt int64
|
||||
isoState *isolationState
|
||||
memChunkPool *sync.Pool
|
||||
head *Head
|
||||
mint, maxt int64
|
||||
isoState *isolationState
|
||||
}
|
||||
|
||||
func (h *headChunkReader) Close() error {
|
||||
|
@ -1503,7 +1501,7 @@ func (h *headChunkReader) Chunk(ref uint64) (chunkenc.Chunk, error) {
|
|||
if garbageCollect {
|
||||
// Set this to nil so that Go GC can collect it after it has been used.
|
||||
c.chunk = nil
|
||||
h.memChunkPool.Put(c)
|
||||
s.memChunkPool.Put(c)
|
||||
}
|
||||
}()
|
||||
|
||||
|
|
Loading…
Reference in a new issue