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

Method MarshalToSizedBuffer

pkg/cortexpb/cortex.pb.go:3250–3281  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

3248}
3249
3250func (m *Exemplar) MarshalToSizedBuffer(dAtA []byte) (int, error) {
3251 i := len(dAtA)
3252 _ = i
3253 var l int
3254 _ = l
3255 if m.TimestampMs != 0 {
3256 i = encodeVarintCortex(dAtA, i, uint64(m.TimestampMs))
3257 i--
3258 dAtA[i] = 0x18
3259 }
3260 if m.Value != 0 {
3261 i -= 8
3262 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
3263 i--
3264 dAtA[i] = 0x11
3265 }
3266 if len(m.Labels) > 0 {
3267 for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- {
3268 {
3269 size := m.Labels[iNdEx].Size()
3270 i -= size
3271 if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil {
3272 return 0, err
3273 }
3274 i = encodeVarintCortex(dAtA, i, uint64(size))
3275 }
3276 i--
3277 dAtA[i] = 0xa
3278 }
3279 }
3280 return len(dAtA) - i, nil
3281}
3282
3283func (m *Histogram) Marshal() (dAtA []byte, err error) {
3284 size := m.Size()

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 3

encodeVarintCortexFunction · 0.85
SizeMethod · 0.65
MarshalToMethod · 0.65

Tested by

no test coverage detected