Etop.Watcher (Etop v0.7.0)
Etop Monitor Helpers.
Setup Etop monitors for handling high CPU usage and process high message queue length reporting.
Monitors
High CPU monitor
This monitor does the following:
- Turns on reporting when the CPU usage exceeds 75% and calls the notify function.
- Turns off the reporting when the CPU usage drops below 50%.
The notify function can be overridden were it can implement a custom handler that
can send an email, post a message to a messaging application, etc.
Message Queue Length monitor
This monitor does the following:
- Calls notify when the length exceeds (1_500) messages.
- Calls notify when the same process exceeding (1_500) messages once its length drops below (1_050) messages
- Kills the process if the message queue length exceeds (20_000) messages and calls notify.
Configuration
The following can be configured with Application.put_env(:infinity_one, option, value):
:etop_msg_q_stop_limit(20_000) - when to kill the process:etop_msg_q_notify_limit(1_500) - when to notify:etop_msg_q_notify_lower_limit(1_000) - When the monitor callback is called:etop_reporting_enable_limit(75.0) - when to enable reporting:etop_reporting_disable_limit(50.0) - when to disable reporting:etop_reporting_notify_lower_limit(10.0) - when to reset the notification state
Limitations
- The CPU utilization monitor aggressively takes over the Etop reporting setting. This means that you can't see/log the Etop data unless the :etop_reporting_enable_limit is exceeded.