mirror of
https://github.com/ClickHouse/ClickHouse.git
synced 2024-09-21 09:10:48 +00:00
Update src/Common/Throttler.cpp
Co-authored-by: Nikita Mikhaylov <mikhaylovnikitka@gmail.com>
This commit is contained in:
parent
4a1bf51ad1
commit
7030828d02
@ -65,7 +65,7 @@ void Throttler::add(size_t amount)
|
||||
|
||||
if (max_speed && current_speed > max_speed)
|
||||
{
|
||||
/// If we was too fast then we have to sleep util our smoothed speed became <= max_speed
|
||||
/// If we was too fast then we have to sleep until our smoothed speed became <= max_speed
|
||||
int64_t sleep_time = -window_ns * std::log2(max_speed / current_speed);
|
||||
|
||||
if (sleep_time > 0)
|
||||
|
Loading…
Reference in New Issue
Block a user