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

Method Size

pkg/cortexpb/cortex.pb.go:3609–3646  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3607}
3608
3609func (m *TimeSeriesV2) Size() (n int) {
3610 if m == nil {
3611 return 0
3612 }
3613 var l int
3614 _ = l
3615 if len(m.LabelsRefs) > 0 {
3616 l = 0
3617 for _, e := range m.LabelsRefs {
3618 l += sovCortex(uint64(e))
3619 }
3620 n += 1 + sovCortex(uint64(l)) + l
3621 }
3622 if len(m.Samples) > 0 {
3623 for _, e := range m.Samples {
3624 l = e.Size()
3625 n += 1 + l + sovCortex(uint64(l))
3626 }
3627 }
3628 if len(m.Histograms) > 0 {
3629 for _, e := range m.Histograms {
3630 l = e.Size()
3631 n += 1 + l + sovCortex(uint64(l))
3632 }
3633 }
3634 if len(m.Exemplars) > 0 {
3635 for _, e := range m.Exemplars {
3636 l = e.Size()
3637 n += 1 + l + sovCortex(uint64(l))
3638 }
3639 }
3640 l = m.Metadata.Size()
3641 n += 1 + l + sovCortex(uint64(l))
3642 if m.CreatedTimestamp != 0 {
3643 n += 1 + sovCortex(uint64(m.CreatedTimestamp))
3644 }
3645 return n
3646}
3647
3648func (m *ExemplarV2) Size() (n int) {
3649 if m == nil {

Callers 3

XXX_SizeMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 2

sovCortexFunction · 0.85
SizeMethod · 0.65

Tested by

no test coverage detected