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

Method MarshalToSizedBuffer

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

Source from the content-addressed store, hash-verified

2962}
2963
2964func (m *WriteResponse) MarshalToSizedBuffer(dAtA []byte) (int, error) {
2965 i := len(dAtA)
2966 _ = i
2967 var l int
2968 _ = l
2969 if m.Exemplars != 0 {
2970 i = encodeVarintCortex(dAtA, i, uint64(m.Exemplars))
2971 i--
2972 dAtA[i] = 0x28
2973 }
2974 if m.Histograms != 0 {
2975 i = encodeVarintCortex(dAtA, i, uint64(m.Histograms))
2976 i--
2977 dAtA[i] = 0x20
2978 }
2979 if m.Samples != 0 {
2980 i = encodeVarintCortex(dAtA, i, uint64(m.Samples))
2981 i--
2982 dAtA[i] = 0x18
2983 }
2984 if len(m.Message) > 0 {
2985 i -= len(m.Message)
2986 copy(dAtA[i:], m.Message)
2987 i = encodeVarintCortex(dAtA, i, uint64(len(m.Message)))
2988 i--
2989 dAtA[i] = 0x12
2990 }
2991 if m.Code != 0 {
2992 i = encodeVarintCortex(dAtA, i, uint64(m.Code))
2993 i--
2994 dAtA[i] = 0x8
2995 }
2996 return len(dAtA) - i, nil
2997}
2998
2999func (m *TimeSeries) Marshal() (dAtA []byte, err error) {
3000 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