| 474 | } |
| 475 | |
| 476 | func (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 | |
| 492 | func (l *Limits) copyNotificationIntegrationLimits(defaults NotificationRateLimitMap) { |
| 493 | l.NotificationRateLimitPerIntegration = make(map[string]float64, len(defaults)) |