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

Method Size

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

Source from the content-addressed store, hash-verified

1730}
1731
1732func (m *RuleStateDesc) Size() (n int) {
1733 if m == nil {
1734 return 0
1735 }
1736 var l int
1737 _ = l
1738 if m.Rule != nil {
1739 l = m.Rule.Size()
1740 n += 1 + l + sovRuler(uint64(l))
1741 }
1742 l = len(m.State)
1743 if l > 0 {
1744 n += 1 + l + sovRuler(uint64(l))
1745 }
1746 l = len(m.Health)
1747 if l > 0 {
1748 n += 1 + l + sovRuler(uint64(l))
1749 }
1750 l = len(m.LastError)
1751 if l > 0 {
1752 n += 1 + l + sovRuler(uint64(l))
1753 }
1754 if len(m.Alerts) > 0 {
1755 for _, e := range m.Alerts {
1756 l = e.Size()
1757 n += 1 + l + sovRuler(uint64(l))
1758 }
1759 }
1760 l = github_com_gogo_protobuf_types.SizeOfStdTime(m.EvaluationTimestamp)
1761 n += 1 + l + sovRuler(uint64(l))
1762 l = github_com_gogo_protobuf_types.SizeOfStdDuration(m.EvaluationDuration)
1763 n += 1 + l + sovRuler(uint64(l))
1764 return n
1765}
1766
1767func (m *AlertStateDesc) Size() (n int) {
1768 if m == nil {

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