mirror of
https://github.com/prometheus/prometheus
synced 2024-12-30 19:03:03 +00:00
Merge pull request #11631 from bboreham/size-meta-alloc
tsdb: use smaller allocation in blockBaseSeriesSet
This commit is contained in:
commit
247201005c
@ -471,7 +471,14 @@ func (b *blockBaseSeriesSet) Next() bool {
|
|||||||
var trimFront, trimBack bool
|
var trimFront, trimBack bool
|
||||||
|
|
||||||
// Copy chunks as iterables are reusable.
|
// Copy chunks as iterables are reusable.
|
||||||
chks := make([]chunks.Meta, 0, len(b.bufChks))
|
// Count those in range to size allocation (roughly - ignoring tombstones).
|
||||||
|
nChks := 0
|
||||||
|
for _, chk := range b.bufChks {
|
||||||
|
if !(chk.MaxTime < b.mint || chk.MinTime > b.maxt) {
|
||||||
|
nChks++
|
||||||
|
}
|
||||||
|
}
|
||||||
|
chks := make([]chunks.Meta, 0, nChks)
|
||||||
|
|
||||||
// Prefilter chunks and pick those which are not entirely deleted or totally outside of the requested range.
|
// Prefilter chunks and pick those which are not entirely deleted or totally outside of the requested range.
|
||||||
for _, chk := range b.bufChks {
|
for _, chk := range b.bufChks {
|
||||||
|
Loading…
Reference in New Issue
Block a user