public class MinTokenBucket extends TokenBucket
TokenBucketthat caps the token balance to some given minimum value. This is useful for quotas where we want to record values into a sensor but temporarily ignore any rate limiting. The
MinTokenBucketwill discount tokens recorded under a given min value, bounding the max throttle experienced once rate limiting is enforced. In comparison, the
TokenBucketwill continuously consume tokens, that would need to be replenished, resulting in unbounded throttle time.
|Constructor and Description|
|Modifier and Type||Method and Description|
measure, record, toString
protected void updateTokens(double tokens)