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

Method calculateMaxSeriesPerLabelSetId

pkg/util/validation/limits.go:476–490  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

474}
475
476func (l *Limits) calculateMaxSeriesPerLabelSetId() error {
477 hMap := map[uint64]struct{}{}
478
479 for k, limit := range l.LimitsPerLabelSet {
480 limit.Id = limit.LabelSet.String()
481 limit.Hash = fnv1a.HashBytes64([]byte(limit.Id))
482 l.LimitsPerLabelSet[k] = limit
483 if _, ok := hMap[limit.Hash]; ok {
484 return errDuplicatePerLabelSetLimit
485 }
486 hMap[limit.Hash] = struct{}{}
487 }
488
489 return nil
490}
491
492func (l *Limits) copyNotificationIntegrationLimits(defaults NotificationRateLimitMap) {
493 l.NotificationRateLimitPerIntegration = make(map[string]float64, len(defaults))

Callers 2

UnmarshalYAMLMethod · 0.95
UnmarshalJSONMethod · 0.95

Implementers 1

Overridespkg/util/validation/limits.go

Calls 1

StringMethod · 0.65

Tested by

no test coverage detected