|
|
|
@ -455,10 +455,10 @@ func (c *concreteSeriesIterator) Seek(t int64) chunkenc.ValueType {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
func getHistogramValType(h *prompb.Histogram) chunkenc.ValueType { |
|
|
|
|
if _, isInt := h.GetCount().(*prompb.Histogram_CountInt); isInt { |
|
|
|
|
return chunkenc.ValHistogram |
|
|
|
|
if h.IsFloatHistogram() { |
|
|
|
|
return chunkenc.ValFloatHistogram |
|
|
|
|
} |
|
|
|
|
return chunkenc.ValFloatHistogram |
|
|
|
|
return chunkenc.ValHistogram |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// At implements chunkenc.Iterator.
|
|
|
|
@ -624,9 +624,11 @@ func exemplarProtoToExemplar(ep prompb.Exemplar) exemplar.Exemplar {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HistogramProtoToHistogram extracts a (normal integer) Histogram from the
|
|
|
|
|
// provided proto message. The caller has to make sure that the proto message
|
|
|
|
|
// represents an integer histogram and not a float histogram.
|
|
|
|
|
// provided proto message.
|
|
|
|
|
func HistogramProtoToHistogram(hp prompb.Histogram) *histogram.Histogram { |
|
|
|
|
if hp.IsFloatHistogram() { |
|
|
|
|
panic("don't call HistogramProtoToHistogram on a float histogram") |
|
|
|
|
} |
|
|
|
|
return &histogram.Histogram{ |
|
|
|
|
CounterResetHint: histogram.CounterResetHint(hp.ResetHint), |
|
|
|
|
Schema: hp.Schema, |
|
|
|
@ -642,9 +644,11 @@ func HistogramProtoToHistogram(hp prompb.Histogram) *histogram.Histogram {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// FloatHistogramProtoToFloatHistogram extracts a float Histogram from the
|
|
|
|
|
// provided proto message to a Float Histogram. The caller has to make sure that
|
|
|
|
|
// the proto message represents a float histogram and not an integer histogram.
|
|
|
|
|
// provided proto message to a Float Histogram.
|
|
|
|
|
func FloatHistogramProtoToFloatHistogram(hp prompb.Histogram) *histogram.FloatHistogram { |
|
|
|
|
if !hp.IsFloatHistogram() { |
|
|
|
|
panic("don't call FloatHistogramProtoToFloatHistogram on an integer histogram") |
|
|
|
|
} |
|
|
|
|
return &histogram.FloatHistogram{ |
|
|
|
|
CounterResetHint: histogram.CounterResetHint(hp.ResetHint), |
|
|
|
|
Schema: hp.Schema, |
|
|
|
@ -660,9 +664,11 @@ func FloatHistogramProtoToFloatHistogram(hp prompb.Histogram) *histogram.FloatHi
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
// HistogramProtoToFloatHistogram extracts and converts a (normal integer) histogram from the provided proto message
|
|
|
|
|
// to a float histogram. The caller has to make sure that the proto message represents an integer histogram and not a
|
|
|
|
|
// float histogram.
|
|
|
|
|
// to a float histogram.
|
|
|
|
|
func HistogramProtoToFloatHistogram(hp prompb.Histogram) *histogram.FloatHistogram { |
|
|
|
|
if hp.IsFloatHistogram() { |
|
|
|
|
panic("don't call HistogramProtoToFloatHistogram on a float histogram") |
|
|
|
|
} |
|
|
|
|
return &histogram.FloatHistogram{ |
|
|
|
|
CounterResetHint: histogram.CounterResetHint(hp.ResetHint), |
|
|
|
|
Schema: hp.Schema, |
|
|
|
|