From d5f9dfd39195ee69def37b603dc68e202be60998 Mon Sep 17 00:00:00 2001 From: Ben Ye Date: Mon, 2 Dec 2024 20:38:16 -0800 Subject: [PATCH] fix type Signed-off-by: Ben Ye --- pkg/querier/codec/protobuf_codec.go | 6 +++--- pkg/querier/codec/protobuf_codec_test.go | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/querier/codec/protobuf_codec.go b/pkg/querier/codec/protobuf_codec.go index 78b1d7c58a7..74aa848be87 100644 --- a/pkg/querier/codec/protobuf_codec.go +++ b/pkg/querier/codec/protobuf_codec.go @@ -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 { @@ -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, diff --git a/pkg/querier/codec/protobuf_codec_test.go b/pkg/querier/codec/protobuf_codec_test.go index 54fa561fd52..09294dc10a5 100644 --- a/pkg/querier/codec/protobuf_codec_test.go +++ b/pkg/querier/codec/protobuf_codec_test.go @@ -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{