From cbfae4ad868403e4133863b321ca615cc1c26086 Mon Sep 17 00:00:00 2001 From: timofey Date: Sun, 13 Nov 2022 04:24:54 +0000 Subject: [PATCH] unprivatise threshold/max --- v6d2ctx/pain.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/v6d2ctx/pain.py b/v6d2ctx/pain.py index 6e1f517..f4774c6 100644 --- a/v6d2ctx/pain.py +++ b/v6d2ctx/pain.py @@ -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: