13 _time_per_token(1000000000 / rate),
14 _time_per_burst(burst * _time_per_token)
20 : _time(tb._time.load()),
21 _time_per_token(tb._time_per_token.load()),
22 _time_per_burst(tb._time_per_burst.load())
28 _time = tb._time.load();
29 _time_per_token = tb._time_per_token.load();
30 _time_per_burst = tb._time_per_burst.load();
Token bucket rate limit algorithm.
TokenBucket(uint64_t rate, uint64_t burst)
Initialize the token bucket.
TokenBucket & operator=(const TokenBucket &tb)
C++ Common project definitions.