NewLimiter makes a new in-memory series limiter
( limits *validation.Overrides, ring RingCount, shardingStrategy string, shardByAllLabels bool, replicationFactor int, zoneAwarenessEnabled bool, AdminLimitMessage string, )
| 47 | |
| 48 | // NewLimiter makes a new in-memory series limiter |
| 49 | func NewLimiter( |
| 50 | limits *validation.Overrides, |
| 51 | ring RingCount, |
| 52 | shardingStrategy string, |
| 53 | shardByAllLabels bool, |
| 54 | replicationFactor int, |
| 55 | zoneAwarenessEnabled bool, |
| 56 | AdminLimitMessage string, |
| 57 | ) *Limiter { |
| 58 | return &Limiter{ |
| 59 | limits: limits, |
| 60 | ring: ring, |
| 61 | replicationFactor: replicationFactor, |
| 62 | shuffleShardingEnabled: shardingStrategy == util.ShardingStrategyShuffle, |
| 63 | shardByAllLabels: shardByAllLabels, |
| 64 | zoneAwarenessEnabled: zoneAwarenessEnabled, |
| 65 | AdminLimitMessage: AdminLimitMessage, |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | // AssertMaxSeriesPerMetric limit has not been reached compared to the current |
| 70 | // number of series in input and returns an error if so. |
no outgoing calls