haskell-distributed / distributed-process-supervisor

Cloud Haskell Supervision Trees
BSD 3-Clause "New" or "Revised" License
11 stars 6 forks source link

Publish mx events and sync on these during testing #7

Closed hyperthunk closed 6 years ago

hyperthunk commented 7 years ago

Currently we trace logs, which is no more or less overhead than publishing mxuser events. Publishing these instead of tracing log messages, we get two benefits. Firstly, you can write a custom formatter for SystemLog and your job is done in terms of logging. Secondly, you can use the management API to track supervisor status. This is especially useful when you're testing, since instead of waiting some arbitrary delay to hope you've ensured the supervisor under test is in a state that is ready for verification, you can wait to see the management events appear. But this also provides a generalised approach to listening for supervisor events, where you might do things like track restart frequency, count the supervisors in your system, etc etc.

hyperthunk commented 6 years ago

This has been implemented now and is used by the tests...