paulscherrerinstitute / StreamDevice

EPICS Driver for message based I/O
GNU General Public License v3.0
28 stars 42 forks source link

Controlling the time to print messages on the IOC shell with a message engine #39

Closed marciodo closed 3 years ago

marciodo commented 5 years ago

The idea is to have a thread that controls when a message should be printed based on a configurable timeout. I tried to make the changes generic, not dependent on EPICS, but it was not fully accomplished. To activate the message engine, an IOC shell function must be used: streamMessageTimeout with the number of seconds of timeout.

The changes are fully compatible with the current version of Stream Device as, if the user doesn't call streamMessageTimeout, the behavior is still the same as before.

Instead of comparing strings, I decided to group the calls to the error macro in numeric categories. This would avoid a frenetic string comparison in the case of hundreds of messages per second being print, which could impact the performance of the message engine.

This is the data structure and the algorithm developed:

Stream Device algorithm for error messages

These are the needed changes in StreamError.h and StreamError.cc.

Original Algorithm

DominicOram commented 3 years ago

This fixes a lot of issues for us so I will pick it back up. I will do the following:

dirk-zimoch commented 3 years ago
* I'm a little worried this is being quite aggressive in how much it throws away...

I was a little worried about the whole thing, too. :-)

DominicOram commented 3 years ago

Fixed merge and build issues. Was going to work on documentation and other issues with @rerpha.

@marciodo, would you be able to give myself and @rerpha permission to push to this branch?

marciodo commented 3 years ago

@DominicOram, I've created a collaborator invitation for both of you. Thank you a lot for working on this. I'll test the fixes later.

DominicOram commented 3 years ago

@dirk-zimoch and @marciodo, could we have a chat tomorrow about how to find a good balance between performance and throwing away messages?

DominicOram commented 3 years ago

@dirk-zimoch, @marciodo and @rerpha. Could we meet in one of the zoom breakout rooms at say 15:30 UTC?

dirk-zimoch commented 3 years ago

OK.

DominicOram commented 3 years ago

I've written up what we discussed in https://github.com/paulscherrerinstitute/StreamDevice/issues/67, I'll have a go at doing it in the next few days

dirk-zimoch commented 3 years ago

A different approach has been implemented.