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

Function newLabelSetCounter

pkg/ingester/user_state.go:104–116  ·  view source on GitHub ↗
(limiter *Limiter)

Source from the content-addressed store, hash-verified

102}
103
104func newLabelSetCounter(limiter *Limiter) *labelSetCounter {
105 shards := make([]*labelSetCounterShard, 0, numMetricCounterShards)
106 for range numMetricCounterShards {
107 shards = append(shards, &labelSetCounterShard{
108 RWMutex: &sync.RWMutex{},
109 valuesCounter: map[uint64]*labelSetCounterEntry{},
110 })
111 }
112 return &labelSetCounter{
113 shards: shards,
114 limiter: limiter,
115 }
116}
117
118func (m *labelSetCounter) canAddSeriesForLabelSet(ctx context.Context, u *userTSDB, metric labels.Labels) error {
119 return m.limiter.AssertMaxSeriesPerLabelSet(u.userID, metric, func(allLimits []validation.LimitsPerLabelSet, limit validation.LimitsPerLabelSet) (int, error) {

Callers 1

createTSDBMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected