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

Public Member Functions

 external_api_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

◆ external_api_health_check()

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

Member Function Documentation

◆ check()

health_check_result external_api_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 86 of file production_monitoring_example.cpp.

86 {
87 // Simulate external API health check
88 return health_check_result::healthy("External API responding");
89 }
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 external_api_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 78 of file production_monitoring_example.cpp.

78 {
79 return name_;
80 }

References name_.

◆ get_type()

health_check_type external_api_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 82 of file production_monitoring_example.cpp.

82 {
83 return health_check_type::readiness;
84 }

◆ is_critical()

bool external_api_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 91 of file production_monitoring_example.cpp.

91 {
92 return false;
93 }

Member Data Documentation

◆ name_

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

Definition at line 73 of file production_monitoring_example.cpp.

Referenced by get_name().


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