Add ability to get number of tokens.

Add a method to fetch the current number of available tokens.
This commit is contained in:
Mark Stemm 2017-04-27 11:22:19 -07:00
parent 060db62644
commit f5ce6752be
2 changed files with 9 additions and 0 deletions

View File

@ -73,3 +73,8 @@ bool token_bucket::claim(uint64_t now)
return true;
}
double token_bucket::get_tokens()
{
return m_tokens;
}

View File

@ -38,6 +38,10 @@ public:
// internal metrics.
//
bool claim(uint64_t now = 0);
// Return the current number of tokens available
double get_tokens();
private:
//