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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

3211}
3212
3213func (m *Metric) MarshalToSizedBuffer(dAtA []byte) (int, error) {
3214 i := len(dAtA)
3215 _ = i
3216 var l int
3217 _ = l
3218 if len(m.Labels) > 0 {
3219 for iNdEx := len(m.Labels) - 1; iNdEx >= 0; iNdEx-- {
3220 {
3221 size := m.Labels[iNdEx].Size()
3222 i -= size
3223 if _, err := m.Labels[iNdEx].MarshalTo(dAtA[i:]); err != nil {
3224 return 0, err
3225 }
3226 i = encodeVarintCortex(dAtA, i, uint64(size))
3227 }
3228 i--
3229 dAtA[i] = 0xa
3230 }
3231 }
3232 return len(dAtA) - i, nil
3233}
3234
3235func (m *Exemplar) Marshal() (dAtA []byte, err error) {
3236 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