mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-10 02:59:38 +00:00
Add ability to get number of tokens.
Add a method to fetch the current number of available tokens.
This commit is contained in:
@@ -73,3 +73,8 @@ bool token_bucket::claim(uint64_t now)
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
double token_bucket::get_tokens()
|
||||
{
|
||||
return m_tokens;
|
||||
}
|
||||
|
@@ -38,6 +38,10 @@ public:
|
||||
// internal metrics.
|
||||
//
|
||||
bool claim(uint64_t now = 0);
|
||||
|
||||
// Return the current number of tokens available
|
||||
double get_tokens();
|
||||
|
||||
private:
|
||||
|
||||
//
|
||||
|
Reference in New Issue
Block a user