[INSTRM-1020] Grab timestamp when constructing/sending commands and command replies. Created: 20/Jun/20  Updated: 20/Jun/20

Status: Open
Project: Instrument control development
Component/s: tron_actorcore
Affects Version/s: None
Fix Version/s: None

Type: Task Priority: Normal
Reporter: cloomis Assignee: cloomis
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   

The timestamps from command replies are recorded when the twisted machinery gets around to it, and not when the code actually sends them.

This is not helpful for real problems, where either the async-style twisted flow or interactions between threads add inscrutable delays, and those are exactly where difficult problems come from.

One non-intrusive fix would to always log (i.e. python logging) the constructed reply as well as its dispatch. But we'd have to make sure that the construction time is used, and not the time on emit().

If we want to track above that, there is a pretty simple option: in the code which constructs the reply, grab the time and add it as a "private" keyword (oh, "__ts" or something). Then when logging, make sure to record both timestamps (and possibly a simple diff, too). The price would be to the text traffic, which will be cluttered by these new keys.


Generated at Sat Feb 10 16:31:03 JST 2024 using Jira 8.3.4#803005-sha1:1f96e09b3c60279a408a2ae47be3c745f571388b.