Abstract base class for health checks.
More...
#include <health_check.h>
Abstract base class for health checks.
This class defines the contract for health check implementations. Subclasses should implement the check() method to perform their specific health verification logic.
Example usage:
public:
std::string
get_name()
const override {
return "database"; }
health_check_result
check()
override {
health_check_result result;
if (db_connection_->is_connected()) {
result.message = "Database connection OK";
} else {
result.message = "Database connection failed";
}
return result;
}
};
Abstract base class for health checks.
virtual health_check_type get_type() const =0
Get the type of this health check.
virtual health_check_result check()=0
Perform the health check.
virtual std::string get_name() const =0
Get the unique name of this health check.
health_check_type
Types of health checks supported by the system.
- Examples
- health_check_example.cpp.
Definition at line 105 of file health_check.h.
◆ health_check() [1/3]
| kcenon::common::interfaces::health_check::health_check |
( |
| ) |
|
|
default |
◆ ~health_check()
| virtual kcenon::common::interfaces::health_check::~health_check |
( |
| ) |
|
|
virtualdefault |
◆ health_check() [2/3]
| kcenon::common::interfaces::health_check::health_check |
( |
const health_check & | | ) |
|
|
delete |
◆ health_check() [3/3]
| kcenon::common::interfaces::health_check::health_check |
( |
health_check && | | ) |
|
|
delete |
◆ check()
◆ get_name()
| virtual std::string kcenon::common::interfaces::health_check::get_name |
( |
| ) |
const |
|
nodiscardpure virtual |
◆ get_timeout()
| virtual std::chrono::milliseconds kcenon::common::interfaces::health_check::get_timeout |
( |
| ) |
const |
|
inlinenodiscardvirtual |
◆ get_type()
| virtual health_check_type kcenon::common::interfaces::health_check::get_type |
( |
| ) |
const |
|
nodiscardpure virtual |
◆ is_critical()
| virtual bool kcenon::common::interfaces::health_check::is_critical |
( |
| ) |
const |
|
inlinenodiscardvirtual |
◆ operator=() [1/2]
◆ operator=() [2/2]
The documentation for this interface was generated from the following file: