|
Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
|
Fluent builder for creating functional_health_check instances. More...
#include <health_monitor.h>

Public Member Functions | |
| health_check_builder & | with_name (const std::string &name) |
| Set the health check name. | |
| health_check_builder & | with_type (health_check_type type) |
| Set the health check type. | |
| health_check_builder & | with_check (std::function< health_check_result()> func) |
| Set the callable that performs the health check. | |
| health_check_builder & | with_timeout (std::chrono::milliseconds timeout) |
| Set the maximum duration allowed for the check. | |
| health_check_builder & | critical (bool is_critical) |
| Mark this check as critical for overall system health. | |
| std::shared_ptr< functional_health_check > | build () |
| Build and return the configured functional_health_check. | |
Private Attributes | |
| std::string | name_ |
| health_check_type | type_ {health_check_type::liveness} |
| std::function< health_check_result()> | check_func_ |
| std::chrono::milliseconds | timeout_ {std::chrono::milliseconds(1000)} |
| bool | critical_ {false} |
Fluent builder for creating functional_health_check instances.
Definition at line 605 of file health_monitor.h.
|
inline |
Build and return the configured functional_health_check.
Definition at line 661 of file health_monitor.h.
References check_func_, critical_, name_, timeout_, and type_.
Referenced by TEST_F().

|
inline |
Mark this check as critical for overall system health.
| is_critical | true if system should be marked unhealthy when this check fails |
Definition at line 652 of file health_monitor.h.
References critical_.
Referenced by TEST_F().

|
inline |
Set the callable that performs the health check.
| func | A callable returning health_check_result |
Definition at line 632 of file health_monitor.h.
References check_func_.
Referenced by TEST_F(), and TEST_F().

|
inline |
Set the health check name.
| name | Human-readable name |
Definition at line 612 of file health_monitor.h.
References name_.
Referenced by TEST_F(), and TEST_F().

|
inline |
Set the maximum duration allowed for the check.
| timeout | Timeout duration |
Definition at line 642 of file health_monitor.h.
References timeout_.
|
inline |
Set the health check type.
| type | The check type (liveness, readiness, or startup) |
Definition at line 622 of file health_monitor.h.
References type_.
Referenced by TEST_F(), and TEST_F().

|
private |
Definition at line 669 of file health_monitor.h.
Referenced by build(), and with_check().
|
private |
|
private |
Definition at line 667 of file health_monitor.h.
Referenced by build(), and with_name().
|
private |
Definition at line 670 of file health_monitor.h.
Referenced by build(), and with_timeout().
|
private |
Definition at line 668 of file health_monitor.h.
Referenced by build(), and with_type().