Skip to content

Commit

Permalink
modify hints proto
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed May 26, 2023
1 parent a6c2a91 commit 042a992
Show file tree
Hide file tree
Showing 7 changed files with 181 additions and 630 deletions.
22 changes: 11 additions & 11 deletions pkg/rules/rulespb/rpc.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

51 changes: 19 additions & 32 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -3189,38 +3189,25 @@ func (s queryStats) merge(o *queryStats) *queryStats {

func (s queryStats) toHints() *hintspb.QueryStats {
return &hintspb.QueryStats{
BlocksQueried: int64(s.blocksQueried),
PostingsTouched: int64(s.postingsTouched),
PostingsTouchedSizeSum: int64(s.PostingsTouchedSizeSum),
PostingsToFetch: int64(s.postingsToFetch),
PostingsFetched: int64(s.postingsFetched),
PostingsFetchedSizeSum: int64(s.PostingsFetchedSizeSum),
PostingsFetchCount: int64(s.postingsFetchCount),
PostingsFetchDurationSum: int64(s.PostingsFetchDurationSum),
CachedPostingsCompressions: int64(s.cachedPostingsCompressions),
CachedPostingsCompressionErrors: int64(s.cachedPostingsCompressionErrors),
CachedPostingsOriginalSizeSum: int64(s.CachedPostingsOriginalSizeSum),
CachedPostingsCompressedSizeSum: int64(s.CachedPostingsCompressedSizeSum),
CachedPostingsCompressionTimeSum: int64(s.CachedPostingsCompressionTimeSum),
CachedPostingsDecompressions: int64(s.cachedPostingsDecompressions),
CachedPostingsDecompressionErrors: int64(s.cachedPostingsDecompressionErrors),
CachedPostingsDecompressionTimeSum: int64(s.CachedPostingsDecompressionTimeSum),
SeriesTouched: int64(s.seriesTouched),
SeriesTouchedSizeSum: int64(s.SeriesTouchedSizeSum),
SeriesFetched: int64(s.seriesFetched),
SeriesFetchedSizeSum: int64(s.SeriesFetchedSizeSum),
SeriesFetchCount: int64(s.seriesFetchCount),
SeriesFetchDurationSum: int64(s.SeriesFetchDurationSum),
ChunksTouched: int64(s.chunksTouched),
ChunksTouchedSizeSum: int64(s.ChunksTouchedSizeSum),
ChunksFetched: int64(s.chunksFetched),
ChunksFetchedSizeSum: int64(s.ChunksFetchedSizeSum),
ChunksFetchCount: int64(s.chunksFetchCount),
ChunksFetchDurationSum: int64(s.ChunksFetchDurationSum),
MergedSeriesCount: int64(s.mergedSeriesCount),
MergedChunksCount: int64(s.mergedChunksCount),
GetAllDuration: int64(s.GetAllDuration),
MergeDuration: int64(s.MergeDuration),
BlocksQueried: int64(s.blocksQueried),
PostingsTouched: int64(s.postingsTouched),
PostingsTouchedSizeSum: int64(s.PostingsTouchedSizeSum),
PostingsToFetch: int64(s.postingsToFetch),
PostingsFetched: int64(s.postingsFetched),
PostingsFetchedSizeSum: int64(s.PostingsFetchedSizeSum),
PostingsFetchCount: int64(s.postingsFetchCount),
SeriesTouched: int64(s.seriesTouched),
SeriesTouchedSizeSum: int64(s.SeriesTouchedSizeSum),
SeriesFetched: int64(s.seriesFetched),
SeriesFetchedSizeSum: int64(s.SeriesFetchedSizeSum),
SeriesFetchCount: int64(s.seriesFetchCount),
ChunksTouched: int64(s.chunksTouched),
ChunksTouchedSizeSum: int64(s.ChunksTouchedSizeSum),
ChunksFetched: int64(s.chunksFetched),
ChunksFetchedSizeSum: int64(s.ChunksFetchedSizeSum),
ChunksFetchCount: int64(s.chunksFetchCount),
MergedSeriesCount: int64(s.mergedSeriesCount),
MergedChunksCount: int64(s.mergedChunksCount),
}
}

Expand Down
13 changes: 0 additions & 13 deletions pkg/store/hintspb/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,38 +25,25 @@ func (m *LabelValuesResponseHints) AddQueriedBlock(id ulid.ULID) {

func (m *QueryStats) Merge(other *QueryStats) {
m.BlocksQueried += other.BlocksQueried
m.MergeDuration += other.MergeDuration
m.GetAllDuration += other.GetAllDuration
m.MergedSeriesCount += other.MergedSeriesCount
m.MergedChunksCount += other.MergedChunksCount

m.CachedPostingsCompressions += other.CachedPostingsCompressions
m.CachedPostingsCompressionErrors += other.CachedPostingsCompressionErrors
m.CachedPostingsCompressedSizeSum += other.CachedPostingsCompressedSizeSum
m.CachedPostingsCompressionTimeSum += other.CachedPostingsCompressionTimeSum
m.CachedPostingsDecompressions += other.CachedPostingsDecompressions
m.CachedPostingsDecompressionErrors += other.CachedPostingsDecompressionErrors
m.CachedPostingsDecompressionTimeSum += other.CachedPostingsDecompressionTimeSum

m.PostingsFetched += other.PostingsFetched
m.PostingsToFetch += other.PostingsToFetch
m.PostingsFetchCount += other.PostingsFetchCount
m.PostingsFetchedSizeSum += other.PostingsFetchedSizeSum
m.PostingsFetchDurationSum += other.PostingsFetchDurationSum
m.PostingsTouched += other.PostingsTouched
m.PostingsTouchedSizeSum += other.PostingsTouchedSizeSum

m.SeriesFetched += other.SeriesFetched
m.SeriesFetchCount += other.SeriesFetchCount
m.SeriesFetchedSizeSum += m.SeriesFetchedSizeSum
m.SeriesFetchDurationSum += m.SeriesFetchDurationSum
m.SeriesTouched += other.SeriesTouched
m.SeriesTouchedSizeSum += other.SeriesTouchedSizeSum

m.ChunksFetched += other.ChunksFetched
m.ChunksFetchCount += other.ChunksFetchCount
m.ChunksFetchedSizeSum += other.ChunksFetchedSizeSum
m.ChunksFetchDurationSum += other.ChunksFetchDurationSum
m.ChunksTouched += other.ChunksTouched
m.ChunksTouchedSizeSum += other.ChunksTouchedSizeSum
}
Loading

0 comments on commit 042a992

Please sign in to comment.