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

Function marshalHistogramBucket

pkg/querier/tripperware/query.go:746–756  ·  view source on GitHub ↗

marshalHistogramBucket writes something like: [ 3, "-0.25", "0.25", "3"] See marshalHistogram to understand what the numbers mean. Adapted from https://github.com/prometheus/client_golang/blob/4b158abea9470f75b6f07460cdc2189b91914562/api/prometheus/v1/api.go#L294.

(b HistogramBucket, stream *jsoniter.Stream)

Source from the content-addressed store, hash-verified

744// See marshalHistogram to understand what the numbers mean.
745// Adapted from https://github.com/prometheus/client_golang/blob/4b158abea9470f75b6f07460cdc2189b91914562/api/prometheus/v1/api.go#L294.
746func marshalHistogramBucket(b HistogramBucket, stream *jsoniter.Stream) {
747 stream.WriteArrayStart()
748 stream.WriteInt32(b.Boundaries)
749 stream.WriteMore()
750 jsonutil.MarshalFloat(b.Lower, stream)
751 stream.WriteMore()
752 jsonutil.MarshalFloat(b.Upper, stream)
753 stream.WriteMore()
754 jsonutil.MarshalFloat(b.Count, stream)
755 stream.WriteArrayEnd()
756}
757
758func (s *PrometheusResponseStats) MarshalJSON() ([]byte, error) {
759 stats := struct {

Callers 1

marshalHistogramFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected