From b7dcb9c373a339896e359923d4c5149729e91c74 Mon Sep 17 00:00:00 2001 From: helintong Date: Wed, 27 Mar 2024 16:44:07 +0800 Subject: [PATCH] feat: add function visit rate_ and burst_size_ --- include/cinatra/token_bucket.hpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/cinatra/token_bucket.hpp b/include/cinatra/token_bucket.hpp index 6d5bbc8e..0571894b 100644 --- a/include/cinatra/token_bucket.hpp +++ b/include/cinatra/token_bucket.hpp @@ -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 bucket_; double rate_;