Skip to content

Commit

Permalink
fix type
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Ye <[email protected]>
  • Loading branch information
yeya24 committed Dec 3, 2024
1 parent 7a1b0a9 commit d5f9dfd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions pkg/querier/codec/protobuf_codec.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,9 +113,9 @@ func getMatrixSampleStreams(data *v1.QueryData) *[]tripperware.SampleStream {
}

histogramsLen := len(sampleStream.Histograms)
var histograms []tripperware.SampleHistogramPair
var histograms []*tripperware.SampleHistogramPair
if histogramsLen > 0 {
histograms = make([]tripperware.SampleHistogramPair, histogramsLen)
histograms = make([]*tripperware.SampleHistogramPair, histogramsLen)
for j := 0; j < histogramsLen; j++ {
bucketsLen := len(sampleStream.Histograms[j].H.NegativeBuckets) + len(sampleStream.Histograms[j].H.PositiveBuckets)
if sampleStream.Histograms[j].H.ZeroCount > 0 {
Expand All @@ -124,7 +124,7 @@ func getMatrixSampleStreams(data *v1.QueryData) *[]tripperware.SampleStream {
buckets := make([]*tripperware.HistogramBucket, bucketsLen)
it := sampleStream.Histograms[j].H.AllBucketIterator()
getBuckets(buckets, it)
histograms[j] = tripperware.SampleHistogramPair{
histograms[j] = &tripperware.SampleHistogramPair{
TimestampMs: sampleStream.Histograms[j].T,
Histogram: tripperware.SampleHistogram{
Count: sampleStream.Histograms[j].H.Count,
Expand Down
2 changes: 1 addition & 1 deletion pkg/querier/codec/protobuf_codec_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ func TestProtobufCodec_Encode(t *testing.T) {
Labels: []cortexpb.LabelAdapter{
{Name: "__name__", Value: "foo"},
},
Histograms: []tripperware.SampleHistogramPair{
Histograms: []*tripperware.SampleHistogramPair{
{
TimestampMs: 1000,
Histogram: tripperware.SampleHistogram{
Expand Down

0 comments on commit d5f9dfd

Please sign in to comment.