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

Method maxMetadataPerMetric

pkg/ingester/limiter.go:246–263  ·  view source on GitHub ↗
(userID string)

Source from the content-addressed store, hash-verified

244}
245
246func (l *Limiter) maxMetadataPerMetric(userID string) int {
247 localLimit := l.limits.MaxLocalMetadataPerMetric(userID)
248 globalLimit := l.limits.MaxGlobalMetadataPerMetric(userID)
249
250 if globalLimit > 0 {
251 if l.shardByAllLabels {
252 localLimit = minNonZero(localLimit, l.convertGlobalToLocalLimit(userID, globalLimit))
253 } else {
254 localLimit = minNonZero(localLimit, globalLimit)
255 }
256 }
257
258 if localLimit == 0 {
259 localLimit = math.MaxInt32
260 }
261
262 return localLimit
263}
264
265func (l *Limiter) maxSeriesPerUser(userID string) int {
266 return l.maxByLocalAndGlobal(

Calls 4

minNonZeroFunction · 0.85

Tested by 1