AssertMaxSeriesPerUser limit has not been reached compared to the current number of series in input and returns an error if so.
(userID string, series int)
| 89 | // AssertMaxSeriesPerUser limit has not been reached compared to the current |
| 90 | // number of series in input and returns an error if so. |
| 91 | func (l *Limiter) AssertMaxSeriesPerUser(userID string, series int) error { |
| 92 | if actualLimit := l.maxSeriesPerUser(userID); series < actualLimit { |
| 93 | return nil |
| 94 | } |
| 95 | |
| 96 | return errMaxSeriesPerUserLimitExceeded |
| 97 | } |
| 98 | |
| 99 | // AssertMaxNativeHistogramSeriesPerUser limit has not been reached compared to the current |
| 100 | // number of native histogram series in input and returns an error if so. |