MCPcopy
hub / github.com/grafana/tempo / MarshalToSizedBuffer

Method MarshalToSizedBuffer

pkg/tempopb/tempo.pb.go:4688–4732  ·  view source on GitHub ↗
(dAtA []byte)

Source from the content-addressed store, hash-verified

4686}
4687
4688func (m *Span) MarshalToSizedBuffer(dAtA []byte) (int, error) {
4689 i := len(dAtA)
4690 _ = i
4691 var l int
4692 _ = l
4693 if len(m.Attributes) > 0 {
4694 for iNdEx := len(m.Attributes) - 1; iNdEx >= 0; iNdEx-- {
4695 {
4696 size, err := m.Attributes[iNdEx].MarshalToSizedBuffer(dAtA[:i])
4697 if err != nil {
4698 return 0, err
4699 }
4700 i -= size
4701 i = encodeVarintTempo(dAtA, i, uint64(size))
4702 }
4703 i--
4704 dAtA[i] = 0x2a
4705 }
4706 }
4707 if m.DurationNanos != 0 {
4708 i = encodeVarintTempo(dAtA, i, uint64(m.DurationNanos))
4709 i--
4710 dAtA[i] = 0x20
4711 }
4712 if m.StartTimeUnixNano != 0 {
4713 i = encodeVarintTempo(dAtA, i, uint64(m.StartTimeUnixNano))
4714 i--
4715 dAtA[i] = 0x18
4716 }
4717 if len(m.Name) > 0 {
4718 i -= len(m.Name)
4719 copy(dAtA[i:], m.Name)
4720 i = encodeVarintTempo(dAtA, i, uint64(len(m.Name)))
4721 i--
4722 dAtA[i] = 0x12
4723 }
4724 if len(m.SpanID) > 0 {
4725 i -= len(m.SpanID)
4726 copy(dAtA[i:], m.SpanID)
4727 i = encodeVarintTempo(dAtA, i, uint64(len(m.SpanID)))
4728 i--
4729 dAtA[i] = 0xa
4730 }
4731 return len(dAtA) - i, nil
4732}
4733
4734func (m *SearchMetrics) Marshal() (dAtA []byte, err error) {
4735 size := m.Size()

Callers 15

XXX_MarshalMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45
MarshalToSizedBufferMethod · 0.45

Calls 1

encodeVarintTempoFunction · 0.85

Tested by

no test coverage detected