Skip to content

Commit

Permalink
add get_all_duration and merge_duration to SG query hints (#6730)
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 authored Sep 19, 2023
1 parent 9524124 commit 18f8035
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 64 deletions.
2 changes: 2 additions & 0 deletions pkg/store/bucket.go
Original file line number Diff line number Diff line change
Expand Up @@ -3647,6 +3647,8 @@ func (s queryStats) toHints() *hintspb.QueryStats {
MergedSeriesCount: int64(s.mergedSeriesCount),
MergedChunksCount: int64(s.mergedChunksCount),
DataDownloadedSizeSum: int64(s.DataDownloadedSizeSum),
GetAllDuration: s.GetAllDuration,
MergeDuration: s.MergeDuration,
}
}

Expand Down
3 changes: 3 additions & 0 deletions pkg/store/hintspb/custom.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,7 @@ func (m *QueryStats) Merge(other *QueryStats) {
m.ChunksFetchedSizeSum += other.ChunksFetchedSizeSum
m.ChunksTouched += other.ChunksTouched
m.ChunksTouchedSizeSum += other.ChunksTouchedSizeSum

m.GetAllDuration += other.GetAllDuration
m.MergeDuration += other.MergeDuration
}
230 changes: 166 additions & 64 deletions pkg/store/hintspb/hints.pb.go

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

3 changes: 3 additions & 0 deletions pkg/store/hintspb/hints.proto
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ syntax = "proto3";
package hintspb;

import "gogoproto/gogo.proto";
import "google/protobuf/duration.proto";
import "store/storepb/types.proto";

option go_package = "hintspb";
Expand Down Expand Up @@ -90,4 +91,6 @@ message QueryStats {
int64 chunks_fetch_count = 19;

int64 data_downloaded_size_sum = 20;
google.protobuf.Duration get_all_duration = 21 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
google.protobuf.Duration merge_duration = 22 [(gogoproto.stdduration) = true, (gogoproto.nullable) = false];
}

0 comments on commit 18f8035

Please sign in to comment.