unprivatise threshold/max
This commit is contained in:
parent
1422f0a762
commit
cbfae4ad86
@ -53,10 +53,9 @@ class FrameTrace(Instrumentation):
|
||||
|
||||
class ABlockMonitor:
|
||||
__task: asyncio.Future
|
||||
__max: float
|
||||
|
||||
def __init__(self, *, threshold=0.0, delta=10.0, interval=0.0) -> None:
|
||||
self.__max = threshold
|
||||
self.threshold = threshold
|
||||
self.delta = delta
|
||||
self.interval = interval
|
||||
|
||||
@ -67,8 +66,8 @@ class ABlockMonitor:
|
||||
await asyncio.sleep(delta)
|
||||
spent = time.time() - t
|
||||
delay = spent - delta
|
||||
if delay > self.__max:
|
||||
self.__max = delay
|
||||
if delay > self.threshold:
|
||||
self.threshold = delay
|
||||
print(f'block monitor reached new peak delay {delay:.4f}')
|
||||
interval = self.interval
|
||||
if interval > 0:
|
||||
|
Loading…
Reference in New Issue
Block a user