|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Health check implementation backed by a std::function. More...
#include <health_monitor.h>


Public Member Functions | |
| functional_health_check (const std::string &name, health_check_type type, std::function< health_check_result()> check_func, std::chrono::milliseconds timeout=std::chrono::milliseconds(1000), bool critical=false) | |
| Construct a functional health check. | |
| std::string | get_name () const override |
| Get the human-readable name of this health check. | |
| health_check_type | get_type () const override |
| Get the type of this health check (liveness, readiness, or startup). | |
| std::chrono::milliseconds | get_timeout () const override |
| Get the maximum time allowed for this check to complete. | |
| bool | is_critical () const override |
| Whether this check is critical for overall system health. | |
| health_check_result | check () override |
| Execute the stored check function. | |
Public Member Functions inherited from kcenon::monitoring::health_check | |
| virtual | ~health_check ()=default |
Private Attributes | |
| std::string | name_ |
| health_check_type | type_ |
| std::function< health_check_result()> | check_func_ |
| std::chrono::milliseconds | timeout_ |
| bool | critical_ |
Health check implementation backed by a std::function.
Wraps a callable as a health_check, allowing health checks to be defined inline without subclassing. Typically created via health_check_builder.
Definition at line 157 of file health_monitor.h.
|
inline |
Construct a functional health check.
| name | Human-readable name for this check |
| type | The check type (liveness, readiness, or startup) |
| check_func | Callable that performs the health check |
| timeout | Maximum duration for the check (default: 1000ms) |
| critical | Whether this check is critical for overall health (default: false) |
Definition at line 167 of file health_monitor.h.
|
inlineoverridevirtual |
Execute the stored check function.
Implements kcenon::monitoring::health_check.
Definition at line 191 of file health_monitor.h.
References check_func_, and kcenon::monitoring::health_check_result::healthy().
Referenced by TEST_F().


|
inlineoverridevirtual |
Get the human-readable name of this health check.
Implements kcenon::monitoring::health_check.
Definition at line 179 of file health_monitor.h.
References name_.
Referenced by TEST_F().

|
inlineoverridevirtual |
Get the maximum time allowed for this check to complete.
Reimplemented from kcenon::monitoring::health_check.
Definition at line 183 of file health_monitor.h.
References timeout_.
|
inlineoverridevirtual |
Get the type of this health check (liveness, readiness, or startup).
Implements kcenon::monitoring::health_check.
Definition at line 181 of file health_monitor.h.
References type_.
Referenced by TEST_F().

|
inlineoverridevirtual |
Whether this check is critical for overall system health.
Reimplemented from kcenon::monitoring::health_check.
Definition at line 185 of file health_monitor.h.
References critical_.
|
private |
Definition at line 201 of file health_monitor.h.
Referenced by check().
|
private |
Definition at line 203 of file health_monitor.h.
Referenced by is_critical().
|
private |
Definition at line 199 of file health_monitor.h.
Referenced by get_name().
|
private |
Definition at line 202 of file health_monitor.h.
Referenced by get_timeout().
|
private |
Definition at line 200 of file health_monitor.h.
Referenced by get_type().