Monitoring System 0.1.0
System resource monitoring with pluggable collectors and alerting
Loading...
Searching...
No Matches
database_health_check Class Reference
Inheritance diagram for database_health_check:
Inheritance graph
Collaboration diagram for database_health_check:
Collaboration graph

Public Member Functions

 database_health_check (const std::string &name)
 
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).
 
health_check_result check () override
 Execute the health check and return the result.
 
bool is_critical () const override
 Whether this check is critical for overall system health.
 
- Public Member Functions inherited from kcenon::monitoring::health_check
virtual ~health_check ()=default
 
virtual std::chrono::milliseconds get_timeout () const
 Get the maximum time allowed for this check to complete.
 

Private Attributes

std::string name_
 

Detailed Description

Constructor & Destructor Documentation

◆ database_health_check()

database_health_check::database_health_check ( const std::string & name)
inlineexplicit

Member Function Documentation

◆ check()

health_check_result database_health_check::check ( )
inlineoverridevirtual

Execute the health check and return the result.

Returns
A health_check_result indicating the current health status

Implements kcenon::monitoring::health_check.

Examples
production_monitoring_example.cpp.

Definition at line 60 of file production_monitoring_example.cpp.

60 {
61 // Simulate database connectivity check
62 return health_check_result::healthy("Database connection pool active");
63 }
static health_check_result healthy(const std::string &msg="OK")

References kcenon::monitoring::health_check_result::healthy().

Here is the call graph for this function:

◆ get_name()

std::string database_health_check::get_name ( ) const
inlineoverridevirtual

Get the human-readable name of this health check.

Returns
The health check name

Implements kcenon::monitoring::health_check.

Examples
production_monitoring_example.cpp.

Definition at line 52 of file production_monitoring_example.cpp.

52 {
53 return name_;
54 }

References name_.

◆ get_type()

health_check_type database_health_check::get_type ( ) const
inlineoverridevirtual

Get the type of this health check (liveness, readiness, or startup).

Returns
The health check type

Implements kcenon::monitoring::health_check.

Examples
production_monitoring_example.cpp.

Definition at line 56 of file production_monitoring_example.cpp.

56 {
57 return health_check_type::readiness;
58 }

◆ is_critical()

bool database_health_check::is_critical ( ) const
inlineoverridevirtual

Whether this check is critical for overall system health.

Returns
true if failure of this check should mark the system as unhealthy (default: false)

Reimplemented from kcenon::monitoring::health_check.

Examples
production_monitoring_example.cpp.

Definition at line 65 of file production_monitoring_example.cpp.

65 {
66 return true;
67 }

Member Data Documentation

◆ name_

std::string database_health_check::name_
private
Examples
production_monitoring_example.cpp.

Definition at line 47 of file production_monitoring_example.cpp.

Referenced by get_name().


The documentation for this class was generated from the following file: