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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

3128}
3129
3130func (m *Sample) MarshalToSizedBuffer(dAtA []byte) (int, error) {
3131 i := len(dAtA)
3132 _ = i
3133 var l int
3134 _ = l
3135 if m.TimestampMs != 0 {
3136 i = encodeVarintCortex(dAtA, i, uint64(m.TimestampMs))
3137 i--
3138 dAtA[i] = 0x10
3139 }
3140 if m.Value != 0 {
3141 i -= 8
3142 encoding_binary.LittleEndian.PutUint64(dAtA[i:], uint64(math.Float64bits(float64(m.Value))))
3143 i--
3144 dAtA[i] = 0x9
3145 }
3146 return len(dAtA) - i, nil
3147}
3148
3149func (m *MetricMetadata) Marshal() (dAtA []byte, err error) {
3150 size := m.Size()

Callers 3

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 1

encodeVarintCortexFunction · 0.85

Tested by

no test coverage detected