|
LCC Fusion Project 1.0
LCC Automation
|
A timer that periodically checks CPU load and logs a warning if it exceeds a configured threshold. More...
#include <CpuCheckTimer.h>
Inherits Timer.
Public Member Functions | |
| CpuCheckTimer (ActiveTimers *timers, uint8_t threshold) | |
| Constructor. More... | |
| long long | timeout () override |
| Called by the OpenMRN timer scheduler at regular intervals. More... | |
Private Attributes | |
| uint8_t | threshold_ |
| CPU load threshold percentage to trigger a warning. | |
A timer that periodically checks CPU load and logs a warning if it exceeds a configured threshold.
This class is intended for monitoring system performance during runtime. It uses OpenMRN's Timer infrastructure and samples CPU load every 33 ms. When the 1-second averaged CPU load exceeds the configured threshold, it logs a warning message.
The actual CPU load is retrieved from CpuLoad::instance().
Definition at line 54 of file CpuCheckTimer.h.
|
inline |
Constructor.
| timers | The OpenMRN ActiveTimers registry this timer will be attached to. |
| threshold | The CPU usage percentage threshold (0–100) that will trigger a warning log. |
Definition at line 63 of file CpuCheckTimer.h.
|
inlineoverride |
Called by the OpenMRN timer scheduler at regular intervals.
This method checks the current CPU load. If it exceeds the configured threshold, a warning is logged.
Definition at line 77 of file CpuCheckTimer.h.