Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
Signed-off-by: Lloyd-Pottiger <yan1579196623@gmail.com>
  • Loading branch information
Lloyd-Pottiger committed Jul 21, 2022
1 parent 411c558 commit ad30d87
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 15 deletions.
18 changes: 4 additions & 14 deletions dbms/src/Encryption/RateLimiter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,10 @@ ReadLimiter::~ReadLimiter()
}
}

// Int64 ReadLimiter::getAvailableBalance()
// {
// TimePoint us = now();
// // Not call getIOStatisctics() every time for performance.
// // If the clock back, elapsed_us could be negative.
// Int64 elapsed_us = std::chrono::duration_cast<std::chrono::microseconds>(us - last_stat_time).count();
// if (get_io_statistic_period_us != 0 && elapsed_us < get_io_statistic_period_us)
// {
// return available_balance;
// }

// return refreshAvailableBalance();
// }
Int64 ReadLimiter::getAvailableBalance()
{
return available_balance;
}

Int64 ReadLimiter::refreshAvailableBalance()
{
Expand Down Expand Up @@ -376,7 +367,6 @@ void ReadLimiter::consumeBytes(Int64 bytes)

bool ReadLimiter::canGrant([[maybe_unused]] Int64 bytes)
{
// return getAvailableBalance() > 0;
return available_balance > 0;
}

Expand Down
2 changes: 1 addition & 1 deletion dbms/src/Encryption/RateLimiter.h
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class ReadLimiter : public WriteLimiter
private:
#endif

// Int64 getAvailableBalance();
Int64 getAvailableBalance();
Int64 refreshAvailableBalance();

std::function<Int64()> get_io_statistic;
Expand Down

0 comments on commit ad30d87

Please sign in to comment.