brayniac / ratelimit

rust ratelimiter
Apache License 2.0
30 stars 5 forks source link

bucket available should initialize as 1 #8

Closed brayniac closed 8 years ago

brayniac commented 8 years ago

There is a non-obvious behavior when the ratelimiter's capacity is set > 1 in that the number of available tokens also initializes to that capacity. For a ratelimit of 1qps this can result in inaccurate rates for capacities > 1.

This relates to twitter/rpc-perf#46