From fbc88857d78c8002fa996ccd6ff214fadf4870de Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Fri, 2 Jun 2023 12:00:45 -0700 Subject: [PATCH] expose downloaded data size in query hints (#6409) Signed-off-by: Ben Ye --- pkg/store/bucket.go | 11 ++++ pkg/store/hintspb/custom.go | 1 + pkg/store/hintspb/hints.pb.go | 113 ++++++++++++++++++++++------------ pkg/store/hintspb/hints.proto | 2 + 4 files changed, 86 insertions(+), 41 deletions(-) diff --git a/pkg/store/bucket.go b/pkg/store/bucket.go index 96368f5c64..dafc08bdd9 100644 --- a/pkg/store/bucket.go +++ b/pkg/store/bucket.go @@ -2393,6 +2393,7 @@ func (r *bucketIndexReader) fetchPostings(ctx context.Context, keys []labels.Lab if err := bytesLimiter.Reserve(uint64(len(dataFromCache))); err != nil { return nil, closeFns, httpgrpc.Errorf(int(codes.ResourceExhausted), "exceeded bytes limit while loading postings from index cache: %s", err) } + r.stats.DataDownloadedSizeSum += units.Base2Bytes(len(dataFromCache)) } // Iterate over all groups and fetch posting from cache. @@ -2466,6 +2467,7 @@ func (r *bucketIndexReader) fetchPostings(ctx context.Context, keys []labels.Lab if err := bytesLimiter.Reserve(uint64(length)); err != nil { return nil, closeFns, httpgrpc.Errorf(int(codes.ResourceExhausted), "exceeded bytes limit while fetching postings: %s", err) } + r.stats.DataDownloadedSizeSum += units.Base2Bytes(length) } g, ctx := errgroup.WithContext(ctx) @@ -2626,6 +2628,7 @@ func (r *bucketIndexReader) PreloadSeries(ctx context.Context, ids []storage.Ser if err := bytesLimiter.Reserve(uint64(len(b))); err != nil { return httpgrpc.Errorf(int(codes.ResourceExhausted), "exceeded bytes limit while loading series from index cache: %s", err) } + r.stats.DataDownloadedSizeSum += units.Base2Bytes(len(b)) } parts := r.block.partitioner.Partition(len(ids), func(i int) (start, end uint64) { @@ -2651,6 +2654,7 @@ func (r *bucketIndexReader) loadSeries(ctx context.Context, ids []storage.Series if err := bytesLimiter.Reserve(uint64(end - start)); err != nil { return httpgrpc.Errorf(int(codes.ResourceExhausted), "exceeded bytes limit while fetching series: %s", err) } + r.stats.DataDownloadedSizeSum += units.Base2Bytes(end - start) } b, err := r.block.readIndexRange(ctx, int64(start), int64(end-start)) @@ -2923,6 +2927,7 @@ func (r *bucketChunkReader) load(ctx context.Context, res []seriesEntry, aggrs [ if err := bytesLimiter.Reserve(uint64(p.End - p.Start)); err != nil { return httpgrpc.Errorf(int(codes.ResourceExhausted), "exceeded bytes limit while fetching chunks: %s", err) } + r.stats.DataDownloadedSizeSum += units.Base2Bytes(p.End - p.Start) } for _, p := range parts { @@ -3040,6 +3045,7 @@ func (r *bucketChunkReader) loadChunks(ctx context.Context, res []seriesEntry, a if err := bytesLimiter.Reserve(uint64(chunkLen)); err != nil { return httpgrpc.Errorf(int(codes.ResourceExhausted), "exceeded bytes limit while fetching chunks: %s", err) } + r.stats.DataDownloadedSizeSum += units.Base2Bytes(chunkLen) nb, err := r.block.readChunkRange(ctx, seq, int64(pIdx.offset), int64(chunkLen), []byteRange{{offset: 0, length: chunkLen}}) if err != nil { return errors.Wrapf(err, "preloaded chunk too small, expecting %d, and failed to fetch full chunk", chunkLen) @@ -3147,6 +3153,8 @@ type queryStats struct { mergedSeriesCount int mergedChunksCount int MergeDuration time.Duration + + DataDownloadedSizeSum units.Base2Bytes } func (s queryStats) merge(o *queryStats) *queryStats { @@ -3187,6 +3195,8 @@ func (s queryStats) merge(o *queryStats) *queryStats { s.mergedChunksCount += o.mergedChunksCount s.MergeDuration += o.MergeDuration + s.DataDownloadedSizeSum += o.DataDownloadedSizeSum + return &s } @@ -3211,6 +3221,7 @@ func (s queryStats) toHints() *hintspb.QueryStats { ChunksFetchCount: int64(s.chunksFetchCount), MergedSeriesCount: int64(s.mergedSeriesCount), MergedChunksCount: int64(s.mergedChunksCount), + DataDownloadedSizeSum: int64(s.DataDownloadedSizeSum), } } diff --git a/pkg/store/hintspb/custom.go b/pkg/store/hintspb/custom.go index 40861143c0..9d7da86e94 100644 --- a/pkg/store/hintspb/custom.go +++ b/pkg/store/hintspb/custom.go @@ -27,6 +27,7 @@ func (m *QueryStats) Merge(other *QueryStats) { m.BlocksQueried += other.BlocksQueried m.MergedSeriesCount += other.MergedSeriesCount m.MergedChunksCount += other.MergedChunksCount + m.DataDownloadedSizeSum += other.DataDownloadedSizeSum m.PostingsFetched += other.PostingsFetched m.PostingsToFetch += other.PostingsToFetch diff --git a/pkg/store/hintspb/hints.pb.go b/pkg/store/hintspb/hints.pb.go index 29f1fc5ae3..457793cf6a 100644 --- a/pkg/store/hintspb/hints.pb.go +++ b/pkg/store/hintspb/hints.pb.go @@ -320,6 +320,7 @@ type QueryStats struct { ChunksFetched int64 `protobuf:"varint,17,opt,name=chunks_fetched,json=chunksFetched,proto3" json:"chunks_fetched,omitempty"` ChunksFetchedSizeSum int64 `protobuf:"varint,18,opt,name=chunks_fetched_size_sum,json=chunksFetchedSizeSum,proto3" json:"chunks_fetched_size_sum,omitempty"` ChunksFetchCount int64 `protobuf:"varint,19,opt,name=chunks_fetch_count,json=chunksFetchCount,proto3" json:"chunks_fetch_count,omitempty"` + DataDownloadedSizeSum int64 `protobuf:"varint,20,opt,name=data_downloaded_size_sum,json=dataDownloadedSizeSum,proto3" json:"data_downloaded_size_sum,omitempty"` } func (m *QueryStats) Reset() { *m = QueryStats{} } @@ -369,47 +370,48 @@ func init() { func init() { proto.RegisterFile("store/hintspb/hints.proto", fileDescriptor_b82aa23c4c11e83f) } var fileDescriptor_b82aa23c4c11e83f = []byte{ - // 627 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0x4b, 0x6f, 0xd3, 0x40, - 0x18, 0x8c, 0x9b, 0x3e, 0xbf, 0x50, 0x37, 0xdd, 0x44, 0xad, 0xdb, 0x83, 0xa9, 0x22, 0x55, 0x2a, - 0xa8, 0x72, 0x51, 0x11, 0x07, 0xe0, 0x44, 0x2b, 0x55, 0x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1b, 0x77, 0x53, 0xdb, 0xf8, 0x3b, 0xb5, - 0x8d, 0x9f, 0x33, 0xbb, 0x71, 0x37, 0xb3, 0x1b, 0xbf, 0x67, 0x76, 0xe3, 0xb3, 0xfc, 0x12, 0x05, - 0xab, 0xec, 0xfb, 0xf2, 0xfc, 0x7f, 0x00, 0x00, 0x00, 0xff, 0xff, 0xe1, 0xb5, 0x3c, 0x87, 0xb6, - 0x06, 0x00, 0x00, + // 652 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x02, 0xff, 0xac, 0x55, 0xcd, 0x4f, 0x13, 0x41, + 0x1c, 0xed, 0x52, 0x3e, 0x7f, 0x95, 0x52, 0xa6, 0x15, 0x16, 0x0e, 0x2b, 0x69, 0x42, 0x82, 0x86, + 0x14, 0x83, 0x31, 0x46, 0x3d, 0x09, 0x86, 0x78, 0x50, 0x13, 0x5a, 0x83, 0x89, 0x9a, 0x4c, 0xf6, + 0x63, 0xec, 0x6e, 0x68, 0x77, 0x96, 0x9d, 0xd9, 0x18, 0xb8, 0x7b, 0x35, 0xfe, 0x59, 0xc4, 0x13, + 0x47, 0x4f, 0x46, 0xe1, 0x1f, 0x31, 0x3b, 0x1f, 0xec, 0x4c, 0xb9, 0xf6, 0x02, 0xcd, 0xfb, 0xbd, + 0xf7, 0xe6, 0xbd, 0xdf, 0x4c, 0xb2, 0xb0, 0xc1, 0x38, 0xcd, 0xc9, 0x5e, 0x9c, 0xa4, 0x9c, 0x65, + 0x81, 0xfc, 0xdf, 0xcb, 0x72, 0xca, 0x29, 0x5a, 0x50, 0xe0, 0x66, 0x67, 0x48, 0x87, 0x54, 0x60, + 0x7b, 0xe5, 0x2f, 0x39, 0xde, 0x54, 0x4a, 0xf1, 0x37, 0x0b, 0xf6, 0xf8, 0x79, 0x46, 0x94, 0xb2, + 0xfb, 0xdd, 0x01, 0x34, 0x20, 0x79, 0x42, 0x58, 0x9f, 0x9c, 0x15,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b, 0xdf, 0x33, 0xdd, 0x75, 0xe3, 0xca, + 0xfd, 0x4e, 0xdf, 0x65, 0xd3, 0x7d, 0xa2, 0xed, 0x2e, 0x20, 0x53, 0xa6, 0xba, 0x36, 0x85, 0xa2, + 0x65, 0x28, 0x6e, 0x9b, 0xaa, 0xc7, 0xa3, 0x9b, 0xae, 0xc8, 0x2c, 0x12, 0x35, 0x9a, 0xda, 0xb4, + 0x2a, 0x4b, 0x4b, 0x66, 0xb1, 0xf8, 0x46, 0x53, 0x25, 0xd3, 0x4d, 0x57, 0x4d, 0x77, 0xa3, 0xa9, + 0x4d, 0xab, 0xdc, 0x91, 0xe9, 0x7e, 0xb7, 0xa9, 0x29, 0x53, 0x4d, 0xdb, 0xb2, 0xa9, 0xa1, 0x90, + 0x4d, 0x9f, 0x81, 0x1b, 0xf9, 0xdc, 0xc7, 0x11, 0xfd, 0x96, 0x8e, 0xa8, 0x1f, 0x99, 0xa7, 0x74, + 0x84, 0xe6, 0x7e, 0x39, 0x7f, 0x7d, 0x3b, 0x56, 0xc7, 0x1c, 0x6c, 0x5f, 0xfe, 0xf3, 0x6a, 0x97, + 0xd7, 0x9e, 0x73, 0x75, 0xed, 0x39, 0x7f, 0xaf, 0x3d, 0xe7, 0xe7, 0x8d, 0x57, 0xbb, 0xba, 0xf1, + 0x6a, 0xbf, 0x6f, 0xbc, 0xda, 0x27, 0xfd, 0x09, 0x0b, 0xe6, 0xc5, 0x87, 0xe9, 0xc9, 0xff, 0x00, + 0x00, 0x00, 0xff, 0xff, 0x4e, 0x26, 0x0a, 0x60, 0xef, 0x06, 0x00, 0x00, } func (m *SeriesRequestHints) Marshal() (dAtA []byte, err error) { @@ -706,6 +708,13 @@ func (m *QueryStats) MarshalToSizedBuffer(dAtA []byte) (int, error) { _ = i var l int _ = l + if m.DataDownloadedSizeSum != 0 { + i = encodeVarintHints(dAtA, i, uint64(m.DataDownloadedSizeSum)) + i-- + dAtA[i] = 0x1 + i-- + dAtA[i] = 0xa0 + } if m.ChunksFetchCount != 0 { i = encodeVarintHints(dAtA, i, uint64(m.ChunksFetchCount)) i-- @@ -996,6 +1005,9 @@ func (m *QueryStats) Size() (n int) { if m.ChunksFetchCount != 0 { n += 2 + sovHints(uint64(m.ChunksFetchCount)) } + if m.DataDownloadedSizeSum != 0 { + n += 2 + sovHints(uint64(m.DataDownloadedSizeSum)) + } return n } @@ -2037,6 +2049,25 @@ func (m *QueryStats) Unmarshal(dAtA []byte) error { break } } + case 20: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field DataDownloadedSizeSum", wireType) + } + m.DataDownloadedSizeSum = 0 + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowHints + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + m.DataDownloadedSizeSum |= int64(b&0x7F) << shift + if b < 0x80 { + break + } + } default: iNdEx = preIndex skippy, err := skipHints(dAtA[iNdEx:]) diff --git a/pkg/store/hintspb/hints.proto b/pkg/store/hintspb/hints.proto index 9c3e074d3a..aeb3ac11d1 100644 --- a/pkg/store/hintspb/hints.proto +++ b/pkg/store/hintspb/hints.proto @@ -88,4 +88,6 @@ message QueryStats { int64 chunks_fetched = 17; int64 chunks_fetched_size_sum = 18; int64 chunks_fetch_count = 19; + + int64 data_downloaded_size_sum = 20; } \ No newline at end of file