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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

3162}
3163
3164func (m *MetricMetadata) MarshalToSizedBuffer(dAtA []byte) (int, error) {
3165 i := len(dAtA)
3166 _ = i
3167 var l int
3168 _ = l
3169 if len(m.Unit) > 0 {
3170 i -= len(m.Unit)
3171 copy(dAtA[i:], m.Unit)
3172 i = encodeVarintCortex(dAtA, i, uint64(len(m.Unit)))
3173 i--
3174 dAtA[i] = 0x2a
3175 }
3176 if len(m.Help) > 0 {
3177 i -= len(m.Help)
3178 copy(dAtA[i:], m.Help)
3179 i = encodeVarintCortex(dAtA, i, uint64(len(m.Help)))
3180 i--
3181 dAtA[i] = 0x22
3182 }
3183 if len(m.MetricFamilyName) > 0 {
3184 i -= len(m.MetricFamilyName)
3185 copy(dAtA[i:], m.MetricFamilyName)
3186 i = encodeVarintCortex(dAtA, i, uint64(len(m.MetricFamilyName)))
3187 i--
3188 dAtA[i] = 0x12
3189 }
3190 if m.Type != 0 {
3191 i = encodeVarintCortex(dAtA, i, uint64(m.Type))
3192 i--
3193 dAtA[i] = 0x8
3194 }
3195 return len(dAtA) - i, nil
3196}
3197
3198func (m *Metric) Marshal() (dAtA []byte, err error) {
3199 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