Skip to content

Commit

Permalink
feat: add function visit rate_ and burst_size_
Browse files Browse the repository at this point in the history
  • Loading branch information
helintongh committed Mar 27, 2024
1 parent 7916fbe commit b7dcb9c
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions include/cinatra/token_bucket.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ class basic_token_bucket {
return bucket_.balance(rate_, burst_size_, now_in_seconds);
}

double rate() const noexcept { return rate_; }

double burst() const noexcept { return burst_size_; }

private:
token_bucket_storage<policy> bucket_;
double rate_;
Expand Down

0 comments on commit b7dcb9c

Please sign in to comment.