|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Trigger based on rate of change of values. More...
#include <alert_triggers.h>


Classes | |
| struct | sample |
Public Types | |
| enum class | rate_direction { increasing , decreasing , either } |
| Direction of rate change to monitor. More... | |
Public Member Functions | |
| rate_of_change_trigger (double rate_threshold, std::chrono::milliseconds window, rate_direction direction=rate_direction::either, size_t min_samples=2) | |
| Construct a rate of change trigger. | |
| bool | evaluate (double value) const override |
| Evaluate the trigger condition. | |
| std::string | type_name () const override |
| Get trigger type name. | |
| std::string | description () const override |
| Get human-readable description. | |
| void | reset () |
| Clear accumulated samples. | |
Public Member Functions inherited from kcenon::monitoring::alert_trigger | |
| virtual | ~alert_trigger ()=default |
Private Member Functions | |
| double | calculate_rate () const |
Private Attributes | |
| double | rate_threshold_ |
| std::chrono::milliseconds | window_ |
| rate_direction | direction_ |
| size_t | min_samples_ |
| std::mutex | mutex_ |
| std::deque< sample > | samples_ |
Trigger based on rate of change of values.
Monitors how quickly a metric value is changing and triggers when the rate exceeds a threshold. Useful for detecting rapid increases or decreases in metrics.
Definition at line 241 of file alert_triggers.h.
|
strong |
Direction of rate change to monitor.
| Enumerator | |
|---|---|
| increasing | Positive rate of change. |
| decreasing | Negative rate of change. |
| either | Absolute rate of change. |
Definition at line 247 of file alert_triggers.h.
|
inline |
Construct a rate of change trigger.
| rate_threshold | Rate threshold per time window |
| window | Time window for rate calculation |
| direction | Direction to monitor |
| min_samples | Minimum samples before triggering |
Definition at line 260 of file alert_triggers.h.
|
inlineprivate |
Definition at line 332 of file alert_triggers.h.
References samples_, and window_.
Referenced by evaluate().

|
inlineoverridevirtual |
Get human-readable description.
Implements kcenon::monitoring::alert_trigger.
Definition at line 307 of file alert_triggers.h.
References decreasing, direction_, either, increasing, rate_threshold_, and window_.
|
inlineoverridevirtual |
Evaluate the trigger condition.
| value | Current metric value |
Implements kcenon::monitoring::alert_trigger.
Definition at line 269 of file alert_triggers.h.
References calculate_rate(), decreasing, direction_, either, increasing, min_samples_, mutex_, rate_threshold_, samples_, and window_.

|
inline |
Clear accumulated samples.
Definition at line 321 of file alert_triggers.h.
|
inlineoverridevirtual |
Get trigger type name.
Implements kcenon::monitoring::alert_trigger.
Definition at line 303 of file alert_triggers.h.
|
private |
Definition at line 367 of file alert_triggers.h.
Referenced by description(), and evaluate().
|
private |
Definition at line 368 of file alert_triggers.h.
Referenced by evaluate().
|
mutableprivate |
Definition at line 370 of file alert_triggers.h.
Referenced by evaluate(), and reset().
|
private |
Definition at line 365 of file alert_triggers.h.
Referenced by description(), and evaluate().
|
mutableprivate |
Definition at line 371 of file alert_triggers.h.
Referenced by calculate_rate(), evaluate(), and reset().
|
private |
Definition at line 366 of file alert_triggers.h.
Referenced by calculate_rate(), description(), and evaluate().