MCPcopy Create free account
hub / github.com/cortexproject/cortex / makeWriteRequestTimeseries

Function makeWriteRequestTimeseries

pkg/distributor/distributor_test.go:3492–3507  ·  view source on GitHub ↗
(labels []cortexpb.LabelAdapter, ts, value int64, histogram bool)

Source from the content-addressed store, hash-verified

3490}
3491
3492func makeWriteRequestTimeseries(labels []cortexpb.LabelAdapter, ts, value int64, histogram bool) cortexpb.PreallocTimeseries {
3493 t := cortexpb.PreallocTimeseries{
3494 TimeSeries: &cortexpb.TimeSeries{
3495 Labels: labels,
3496 },
3497 }
3498 if histogram {
3499 t.Histograms = append(t.Histograms, cortexpb.WrapHistogram(cortexpb.HistogramToHistogramProto(ts, tsdbutil.GenerateTestHistogram(value))))
3500 } else {
3501 t.Samples = append(t.Samples, cortexpb.Sample{
3502 TimestampMs: ts,
3503 Value: float64(value),
3504 })
3505 }
3506 return t
3507}
3508
3509func makeWriteRequestTimeseriesNHCB(labels []cortexpb.LabelAdapter, ts, value int64) cortexpb.PreallocTimeseries {
3510 return cortexpb.PreallocTimeseries{

Calls 2

WrapHistogramFunction · 0.92

Tested by

no test coverage detected