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

Function NewLabelSetTracker

pkg/util/labelset/tracker.go:21–30  ·  view source on GitHub ↗

NewLabelSetTracker initializes a LabelSetTracker to keep track of active labelset limits.

()

Source from the content-addressed store, hash-verified

19
20// NewLabelSetTracker initializes a LabelSetTracker to keep track of active labelset limits.
21func NewLabelSetTracker() *LabelSetTracker {
22 shards := make([]*labelSetCounterShard, 0, numMetricShards)
23 for range numMetricShards {
24 shards = append(shards, &labelSetCounterShard{
25 RWMutex: &sync.RWMutex{},
26 userLabelSets: map[string]map[uint64]labels.Labels{},
27 })
28 }
29 return &LabelSetTracker{shards: shards}
30}
31
32type labelSetCounterShard struct {
33 *sync.RWMutex

Callers 4

NewFunction · 0.92
NewValidateMetricsFunction · 0.92
TestLabelSetTrackerFunction · 0.85

Calls

no outgoing calls

Tested by 2

TestLabelSetTrackerFunction · 0.68