Add Ratelimiter.__repr__.
This commit is contained in:
parent
6d8a406ceb
commit
8f8a39eaca
1 changed files with 3 additions and 0 deletions
|
@ -53,6 +53,9 @@ class Ratelimiter:
|
||||||
self.last_operation = time.monotonic()
|
self.last_operation = time.monotonic()
|
||||||
self.balance = 0
|
self.balance = 0
|
||||||
|
|
||||||
|
def __repr__(self):
|
||||||
|
return f'{self.__class__.__name__}(allowance={self.allowance}, period={self.period})'
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def gain_rate(self):
|
def gain_rate(self):
|
||||||
return self.allowance / self.period
|
return self.allowance / self.period
|
||||||
|
|
Loading…
Reference in a new issue