chore(mo1_bragg): temporary ACS GETVAR interval debug logging
CI for debye_bec / test (push) Successful in 3m8s
CI for debye_bec / test (push) Successful in 3m8s
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user