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

Method AssertMaxSeriesPerUser

pkg/ingester/limiter.go:91–97  ·  view source on GitHub ↗

AssertMaxSeriesPerUser limit has not been reached compared to the current number of series in input and returns an error if so.

(userID string, series int)

Source from the content-addressed store, hash-verified

89// AssertMaxSeriesPerUser limit has not been reached compared to the current
90// number of series in input and returns an error if so.
91func (l *Limiter) AssertMaxSeriesPerUser(userID string, series int) error {
92 if actualLimit := l.maxSeriesPerUser(userID); series < actualLimit {
93 return nil
94 }
95
96 return errMaxSeriesPerUserLimitExceeded
97}
98
99// AssertMaxNativeHistogramSeriesPerUser limit has not been reached compared to the current
100// number of native histogram series in input and returns an error if so.

Callers 2

PreCreationMethod · 0.80

Calls 1

maxSeriesPerUserMethod · 0.95

Tested by 1