Add Ratelimiter.__repr__.

This commit is contained in:
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

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