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

Method AssertMaxMetadataPerMetric

pkg/ingester/limiter.go:81–87  ·  view source on GitHub ↗

AssertMaxMetadataPerMetric limit has not been reached compared to the current number of metadata per metric in input and returns an error if so.

(userID string, metadata int)

Source from the content-addressed store, hash-verified

79// AssertMaxMetadataPerMetric limit has not been reached compared to the current
80// number of metadata per metric in input and returns an error if so.
81func (l *Limiter) AssertMaxMetadataPerMetric(userID string, metadata int) error {
82 if actualLimit := l.maxMetadataPerMetric(userID); metadata < actualLimit {
83 return nil
84 }
85
86 return errMaxMetadataPerMetricLimitExceeded
87}
88
89// AssertMaxSeriesPerUser limit has not been reached compared to the current
90// number of series in input and returns an error if so.

Callers 2

addMethod · 0.80

Calls 1

maxMetadataPerMetricMethod · 0.95

Tested by 1