MCPcopy Index your code
hub / github.com/cortexproject/cortex / AppendHistogram

Method AppendHistogram

pkg/ruler/compat.go:55–66  ·  view source on GitHub ↗
(_ storage.SeriesRef, l labels.Labels, t int64, h *histogram.Histogram, fh *histogram.FloatHistogram)

Source from the content-addressed store, hash-verified

53}
54
55func (a *PusherAppender) AppendHistogram(_ storage.SeriesRef, l labels.Labels, t int64, h *histogram.Histogram, fh *histogram.FloatHistogram) (storage.SeriesRef, error) {
56 if h == nil && fh == nil {
57 return 0, errors.New("no histogram")
58 }
59 if h != nil {
60 a.histograms = append(a.histograms, cortexpb.WrappedHistogram{Histogram: cortexpb.HistogramToHistogramProto(t, h)})
61 } else {
62 a.histograms = append(a.histograms, cortexpb.WrappedHistogram{Histogram: cortexpb.FloatHistogramToHistogramProto(t, fh)})
63 }
64 a.histogramLabels = append(a.histogramLabels, l)
65 return 0, nil
66}
67
68func (a *PusherAppender) Append(_ storage.SeriesRef, l labels.Labels, t int64, v float64) (storage.SeriesRef, error) {
69 a.labels = append(a.labels, l)

Callers 7

CreateNHBlockFunction · 0.45
mockSeriesResponseFunction · 0.45
ConvertToChunksFunction · 0.45
PushMethod · 0.45
TestPusherAppendableFunction · 0.45
TestPusherErrorsFunction · 0.45

Calls 2

Tested by 4

mockSeriesResponseFunction · 0.36
TestPusherAppendableFunction · 0.36
TestPusherErrorsFunction · 0.36