NewLabelSetTracker initializes a LabelSetTracker to keep track of active labelset limits.
()
| 19 | |
| 20 | // NewLabelSetTracker initializes a LabelSetTracker to keep track of active labelset limits. |
| 21 | func 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 | |
| 32 | type labelSetCounterShard struct { |
| 33 | *sync.RWMutex |
no outgoing calls