mirror of
https://github.com/falcosecurity/falco.git
synced 2025-08-15 21:03:54 +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:
parent
060db62644
commit
f5ce6752be
@ -73,3 +73,8 @@ bool token_bucket::claim(uint64_t now)
|
|||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
double token_bucket::get_tokens()
|
||||||
|
{
|
||||||
|
return m_tokens;
|
||||||
|
}
|
||||||
|
@ -38,6 +38,10 @@ public:
|
|||||||
// internal metrics.
|
// internal metrics.
|
||||||
//
|
//
|
||||||
bool claim(uint64_t now = 0);
|
bool claim(uint64_t now = 0);
|
||||||
|
|
||||||
|
// Return the current number of tokens available
|
||||||
|
double get_tokens();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
//
|
//
|
||||||
|
Loading…
Reference in New Issue
Block a user