From 6e99e4d74e02b239e34b077c91d93e7df1fcaa87 Mon Sep 17 00:00:00 2001 From: wyzula-jan Date: Wed, 5 Aug 2026 14:06:20 +0200 Subject: [PATCH] chore(mo1_bragg): temporary ACS GETVAR interval debug logging --- debye_bec/devices/mo1_bragg/acs.py | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/debye_bec/devices/mo1_bragg/acs.py b/debye_bec/devices/mo1_bragg/acs.py index 28ffd23..e1b035a 100644 --- a/debye_bec/devices/mo1_bragg/acs.py +++ b/debye_bec/devices/mo1_bragg/acs.py @@ -115,6 +115,7 @@ class AcsSignal(SocketSignal): self.enum = enum self.cache_ttl = cache_ttl self._last_hw_read: float | None = None + self.last_get = time.time() # required by the interval debug log in _socket_get super().__init__(*args, **kwargs) @property @@ -170,6 +171,16 @@ class AcsSignal(SocketSignal): return old_value == new_value def _socket_get(self): + now = time.time() + interval = now - self.last_get + self.last_get = now + # "[acs-cache]" marks the NEW cached implementation in the logs; the old acs.py + # logs "Get signal with tag ..." on every read, so the prefix proves which code + # the device server actually imported + logger.info( + f"[acs-cache] hardware GETVAR tag {self.tag}, {interval * 1e3:.1f} ms since last read" + ) + def convert(val): return self.enum(val).name if self.enum is not None else val