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

Function MarshalSampleHistogramPairJSON

pkg/querier/tripperware/query.go:681–688  ·  view source on GitHub ↗

Adapted from https://github.com/prometheus/client_golang/blob/4b158abea9470f75b6f07460cdc2189b91914562/api/prometheus/v1/api.go#L137.

(ptr unsafe.Pointer, stream *jsoniter.Stream)

Source from the content-addressed store, hash-verified

679
680// Adapted from https://github.com/prometheus/client_golang/blob/4b158abea9470f75b6f07460cdc2189b91914562/api/prometheus/v1/api.go#L137.
681func MarshalSampleHistogramPairJSON(ptr unsafe.Pointer, stream *jsoniter.Stream) {
682 p := *((*SampleHistogramPair)(ptr))
683 stream.WriteArrayStart()
684 stream.WriteFloat64(float64(p.TimestampMs) / float64(time.Second/time.Millisecond))
685 stream.WriteMore()
686 marshalHistogram(p.Histogram, stream)
687 stream.WriteArrayEnd()
688}
689
690// MarshalHistogram marshals a histogram value using the passed jsoniter stream.
691// It writes something like:

Callers 2

encodeSampleStreamFunction · 0.85
encodeSampleFunction · 0.85

Calls 1

marshalHistogramFunction · 0.85

Tested by

no test coverage detected