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

Method AssertMaxMetricsWithMetadataPerUser

pkg/ingester/limiter.go:111–117  ·  view source on GitHub ↗

AssertMaxMetricsWithMetadataPerUser limit has not been reached compared to the current number of metrics with metadata in input and returns an error if so.

(userID string, metrics int)

Source from the content-addressed store, hash-verified

109// AssertMaxMetricsWithMetadataPerUser limit has not been reached compared to the current
110// number of metrics with metadata in input and returns an error if so.
111func (l *Limiter) AssertMaxMetricsWithMetadataPerUser(userID string, metrics int) error {
112 if actualLimit := l.maxMetadataPerUser(userID); metrics < actualLimit {
113 return nil
114 }
115
116 return errMaxMetadataPerUserLimitExceeded
117}
118
119// AssertMaxSeriesPerLabelSet limit has not been reached compared to the current
120// number of metrics with metadata in input and returns an error if so.

Callers 2

addMethod · 0.80

Calls 1

maxMetadataPerUserMethod · 0.95