github.com/thanos-io/thanos@v0.32.5/pkg/store/hintspb/custom.go (about)

     1  // Copyright (c) The Thanos Authors.
     2  // Licensed under the Apache License 2.0.
     3  
     4  package hintspb
     5  
     6  import "github.com/oklog/ulid"
     7  
     8  func (m *SeriesResponseHints) AddQueriedBlock(id ulid.ULID) {
     9  	m.QueriedBlocks = append(m.QueriedBlocks, Block{
    10  		Id: id.String(),
    11  	})
    12  }
    13  
    14  func (m *LabelNamesResponseHints) AddQueriedBlock(id ulid.ULID) {
    15  	m.QueriedBlocks = append(m.QueriedBlocks, Block{
    16  		Id: id.String(),
    17  	})
    18  }
    19  
    20  func (m *LabelValuesResponseHints) AddQueriedBlock(id ulid.ULID) {
    21  	m.QueriedBlocks = append(m.QueriedBlocks, Block{
    22  		Id: id.String(),
    23  	})
    24  }
    25  
    26  func (m *QueryStats) Merge(other *QueryStats) {
    27  	m.BlocksQueried += other.BlocksQueried
    28  	m.MergedSeriesCount += other.MergedSeriesCount
    29  	m.MergedChunksCount += other.MergedChunksCount
    30  	m.DataDownloadedSizeSum += other.DataDownloadedSizeSum
    31  
    32  	m.PostingsFetched += other.PostingsFetched
    33  	m.PostingsToFetch += other.PostingsToFetch
    34  	m.PostingsFetchCount += other.PostingsFetchCount
    35  	m.PostingsFetchedSizeSum += other.PostingsFetchedSizeSum
    36  	m.PostingsTouched += other.PostingsTouched
    37  	m.PostingsTouchedSizeSum += other.PostingsTouchedSizeSum
    38  
    39  	m.SeriesFetched += other.SeriesFetched
    40  	m.SeriesFetchCount += other.SeriesFetchCount
    41  	m.SeriesFetchedSizeSum += other.SeriesFetchedSizeSum
    42  	m.SeriesTouched += other.SeriesTouched
    43  	m.SeriesTouchedSizeSum += other.SeriesTouchedSizeSum
    44  
    45  	m.ChunksFetched += other.ChunksFetched
    46  	m.ChunksFetchCount += other.ChunksFetchCount
    47  	m.ChunksFetchedSizeSum += other.ChunksFetchedSizeSum
    48  	m.ChunksTouched += other.ChunksTouched
    49  	m.ChunksTouchedSizeSum += other.ChunksTouchedSizeSum
    50  }