Common System 0.2.0
Common interfaces and patterns for system integration
Loading...
Searching...
No Matches
cache_readiness_check Class Reference
Inheritance diagram for cache_readiness_check:
Inheritance graph
Collaboration diagram for cache_readiness_check:
Collaboration graph

Public Member Functions

 cache_readiness_check (bool warmed)
 
std::string get_name () const override
 Get the unique name of this health check.
 
health_check_type get_type () const override
 Get the type of this health check.
 
bool is_critical () const override
 Check if this health check is critical.
 
std::chrono::milliseconds get_timeout () const override
 Get timeout duration for this health check.
 
health_check_result check () override
 Perform the health check.
 
- Public Member Functions inherited from kcenon::common::interfaces::health_check
 health_check ()=default
 
virtual ~health_check ()=default
 
 health_check (const health_check &)=delete
 
health_checkoperator= (const health_check &)=delete
 
 health_check (health_check &&)=delete
 
health_checkoperator= (health_check &&)=delete
 

Private Attributes

bool cache_warmed_
 

Detailed Description

Examples
health_check_example.cpp.

Definition at line 45 of file health_check_example.cpp.

Constructor & Destructor Documentation

◆ cache_readiness_check()

cache_readiness_check::cache_readiness_check ( bool warmed)
inlineexplicit
Examples
health_check_example.cpp.

Definition at line 48 of file health_check_example.cpp.

Member Function Documentation

◆ check()

health_check_result cache_readiness_check::check ( )
inlineoverridevirtual

Perform the health check.

Returns
Health check result containing status and details

Implements kcenon::common::interfaces::health_check.

Examples
health_check_example.cpp.

Definition at line 59 of file health_check_example.cpp.

60 {
62 if (cache_warmed_)
63 {
64 result.status = health_status::healthy;
65 result.message = "Cache is warmed";
66 }
67 else
68 {
69 result.status = health_status::degraded;
70 result.message = "Cache warming in progress";
71 }
72 return result;
73 }

References cache_warmed_, kcenon::common::interfaces::health_check_result::message, and kcenon::common::interfaces::health_check_result::status.

◆ get_name()

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

Get the unique name of this health check.

Returns
Health check name

Implements kcenon::common::interfaces::health_check.

Examples
health_check_example.cpp.

Definition at line 50 of file health_check_example.cpp.

50{ return "cache_readiness"; }

◆ get_timeout()

std::chrono::milliseconds cache_readiness_check::get_timeout ( ) const
inlineoverridevirtual

Get timeout duration for this health check.

Returns
Timeout duration (default: 5 seconds)

Implements kcenon::common::interfaces::health_check.

Examples
health_check_example.cpp.

Definition at line 54 of file health_check_example.cpp.

55 {
56 return std::chrono::milliseconds(2000);
57 }

◆ get_type()

health_check_type cache_readiness_check::get_type ( ) const
inlineoverridevirtual

Get the type of this health check.

Returns
Health check type

Implements kcenon::common::interfaces::health_check.

Examples
health_check_example.cpp.

Definition at line 51 of file health_check_example.cpp.

51{ return health_check_type::readiness; }

◆ is_critical()

bool cache_readiness_check::is_critical ( ) const
inlineoverridevirtual

Check if this health check is critical.

Critical health checks affect the overall system health status. Non-critical checks are reported but don't impact system health.

Returns
true if this is a critical health check

Implements kcenon::common::interfaces::health_check.

Examples
health_check_example.cpp.

Definition at line 52 of file health_check_example.cpp.

52{ return false; }

Member Data Documentation

◆ cache_warmed_

bool cache_readiness_check::cache_warmed_
private
Examples
health_check_example.cpp.

Definition at line 76 of file health_check_example.cpp.

Referenced by check().


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