Report 'enc_freq' timestamp in 'hwp_state' of hwp supervisor monitor process
Opened this issue · 0 comments
During normal operation on ocs-web I always see the Encoder Summary report something like, "1.9928 Hz, ? ago". The "? ago" makes me not really trust whether the rotation rate is reporting correctly, especially when the HWP is stopped.
I dug into this and found ocs-web is expecting 'encoder_last_updated'
at the same level as 'enc_freq'
in the response dict.
However, the supervisor agent appears to be exposing only part of the encoder agent's session data in the high level 'hwp_state'
part of its session.data
. The frequency and timestamp are still available under 'monitored_sessions'
, but based on the 'enc_freq'
, 'last_quad'
, and 'last_quad_time'
being reported in 'hwp_state'
, I think we should also add 'encoder_last_updated'
in this part of the response. If it uses this key then ocs-web should report the time without modification, though 'enc_freq_time'
would present a consistent convention.
The alternative is to get ocs-web to inspect 'monitored_sessions'
instead. In either case the documentation of the session.data
object should be improved in the supervisor's docstrings, as this issue seems to stem, at least in part, from unclear documentation of the session.data
structure. For instance 'hwp_state'
is just 'state'
in the docstring and 'enc_freq'
is 'hwp_freq'
.
EDIT: Snapshot of supervisor response:
supervisor-monitor-resp-snapshot.txt
And encoder response:
$ ocs-client-cli shell hwp-bbb-e1
>>> resp.session['data']
{'approx_hwp_freq': 2.029514746238338, 'encoder_last_updated': 1730651039.5944421, 'irig_time': 1730651040, 'irig_last_updated': 1730651041.0075893, 'last_quad': 0, 'last_quad_time': 1730651039.5947278}
socs image tag: v0.5.1-22-g7d2f158-dev