mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-11-15 03:53:41 +00:00
update actual amount of tokens in bucket
This commit is contained in:
parent
1787803157
commit
c5f3170a82
@ -125,7 +125,9 @@ public:
|
||||
|
||||
double getTokens() const
|
||||
{
|
||||
return tokens;
|
||||
auto now = event_queue->now();
|
||||
double elapsed = std::chrono::nanoseconds(now - last_update).count() / 1e9;
|
||||
return std::min(tokens + max_speed * elapsed, max_burst);
|
||||
}
|
||||
|
||||
std::chrono::nanoseconds getThrottlingDuration() const
|
||||
|
Loading…
Reference in New Issue
Block a user