From ad601984d12d11cf5ca623de5fd1116e32abd1c8 Mon Sep 17 00:00:00 2001 From: "Peter J. Holzer" Date: Sat, 4 Feb 2023 12:19:01 +0100 Subject: [PATCH] Add some debug messages --- dashboard.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/dashboard.py b/dashboard.py index a90179b..f071f5a 100644 --- a/dashboard.py +++ b/dashboard.py @@ -176,6 +176,7 @@ class TimeSeries(Widget): x0 = tickmarks[-1]["x"] d0 = datetime.datetime.fromtimestamp(t0) + log.debug("step_i = %s", step_i) if steps[step_i] == "s": d1 = datetime.datetime(d0.year, d0.month, d0.day, d0.hour, d0.minute, d0.second) t1 = d1.timestamp() @@ -287,6 +288,7 @@ class TimeSeries(Widget): t1 = d1.timestamp() x1 = t2x(t1) if x0 - x1 < min_step: + log.debug("t0 = %s, x0 = %s, t1 = %s, x1 = %s", t0, x0, t1, x1) step_i += 1 continue if x1 < 0: @@ -383,7 +385,7 @@ class TimeSeries(Widget): log.debug("") - log.debug("in graph") + log.debug("in graph for %s", self.lts.id) data = self.lts.data n = len(data) t_last = data[-1][0] @@ -391,6 +393,7 @@ class TimeSeries(Widget): return "(not enough data)" dt = (t_last - data[-5][0]) / 4 k = math.log((t_last - data[0][0]) / dt / n + 1) + log.debug("times = [%s ... %s ... %s]", data[0][0], data[-5][0], data[-1][0]) max_value = max([d[3] if len(d) >= 4 else d[1] for d in self.lts.data]) max_value = max(max_value, 0.001) # ensure positive