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

Function numTokens

pkg/ruler/lifecycle_test.go:100–110  ·  view source on GitHub ↗

numTokens determines the number of tokens owned by the specified address

(c kv.Client, name, ringKey string)

Source from the content-addressed store, hash-verified

98// numTokens determines the number of tokens owned by the specified
99// address
100func numTokens(c kv.Client, name, ringKey string) int {
101 ringDesc, err := c.Get(context.Background(), ringKey)
102
103 // The ringDesc may be null if the lifecycler hasn't stored the ring
104 // to the KVStore yet.
105 if ringDesc == nil || err != nil {
106 return 0
107 }
108 rd := ringDesc.(*ring.Desc)
109 return len(rd.Ingesters[name].Tokens)
110}

Callers 1

TestRulerShutdownFunction · 0.70

Calls 1

GetMethod · 0.65

Tested by

no test coverage detected