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)
| 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. |
| 81 | func (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. |