Add Ratelimiter.__repr__.

master
voussoir 2021-11-20 18:52:00 -08:00
parent 6d8a406ceb
commit 8f8a39eaca
No known key found for this signature in database
GPG Key ID: 5F7554F8C26DACCB
1 changed files with 3 additions and 0 deletions

View File

@ -53,6 +53,9 @@ class Ratelimiter:
self.last_operation = time.monotonic()
self.balance = 0
def __repr__(self):
return f'{self.__class__.__name__}(allowance={self.allowance}, period={self.period})'
@property
def gain_rate(self):
return self.allowance / self.period