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

Method Size

pkg/ruler/ruler.pb.go:1767–1805  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1765}
1766
1767func (m *AlertStateDesc) Size() (n int) {
1768 if m == nil {
1769 return 0
1770 }
1771 var l int
1772 _ = l
1773 l = len(m.State)
1774 if l > 0 {
1775 n += 1 + l + sovRuler(uint64(l))
1776 }
1777 if len(m.Labels) > 0 {
1778 for _, e := range m.Labels {
1779 l = e.Size()
1780 n += 1 + l + sovRuler(uint64(l))
1781 }
1782 }
1783 if len(m.Annotations) > 0 {
1784 for _, e := range m.Annotations {
1785 l = e.Size()
1786 n += 1 + l + sovRuler(uint64(l))
1787 }
1788 }
1789 if m.Value != 0 {
1790 n += 9
1791 }
1792 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ActiveAt)
1793 n += 1 + l + sovRuler(uint64(l))
1794 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.FiredAt)
1795 n += 1 + l + sovRuler(uint64(l))
1796 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ResolvedAt)
1797 n += 1 + l + sovRuler(uint64(l))
1798 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.LastSentAt)
1799 n += 1 + l + sovRuler(uint64(l))
1800 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.ValidUntil)
1801 n += 1 + l + sovRuler(uint64(l))
1802 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.KeepFiringSince)
1803 n += 1 + l + sovRuler(uint64(l))
1804 return n
1805}
1806
1807func sovRuler(x uint64) (n int) {
1808 return (math_bits.Len64(x|1) + 6) / 7

Callers 3

XXX_SizeMethod · 0.95
MarshalMethod · 0.95
MarshalToMethod · 0.95

Calls 2

sovRulerFunction · 0.85
SizeMethod · 0.65

Tested by

no test coverage detected