PACS System 0.1.0
PACS DICOM system library
Loading...
Searching...
No Matches
kcenon::pacs::monitoring::health_status Struct Reference

Comprehensive health status of the PACS system. More...

#include <health_status.h>

Collaboration diagram for kcenon::pacs::monitoring::health_status:
Collaboration graph

Public Member Functions

void update_level () noexcept
 Calculate overall health level from component status.
 
bool is_healthy () const noexcept
 Check if the system is healthy.
 
bool is_operational () const noexcept
 Check if the system is at least operational.
 

Public Attributes

health_level level {health_level::unhealthy}
 Overall health level.
 
std::chrono::system_clock::time_point timestamp
 Timestamp of this health check.
 
database_status database
 Database connection status.
 
storage_status storage
 Storage subsystem status.
 
association_metrics associations
 DICOM association metrics.
 
storage_metrics metrics
 Storage operation metrics.
 
version_info version
 Version and uptime information.
 
std::optional< std::string > message
 Optional human-readable status message.
 

Detailed Description

Comprehensive health status of the PACS system.

This struct aggregates all component health information into a single data structure suitable for health check endpoints and monitoring systems.

Thread Safety: Read operations are thread-safe. Write operations require external synchronization.

Definition at line 213 of file health_status.h.

Member Function Documentation

◆ is_healthy()

bool kcenon::pacs::monitoring::health_status::is_healthy ( ) const
inlinenodiscardnoexcept

Check if the system is healthy.

Returns
true if health level is healthy
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 277 of file health_status.h.

277 {
279 }
@ healthy
All components healthy, system fully operational.
health_level level
Overall health level.

References kcenon::pacs::monitoring::healthy, and level.

◆ is_operational()

bool kcenon::pacs::monitoring::health_status::is_operational ( ) const
inlinenodiscardnoexcept

Check if the system is at least operational.

Returns
true if health level is healthy or degraded
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 285 of file health_status.h.

285 {
287 }
@ unhealthy
Critical components failing, system may not function correctly.

References level, and kcenon::pacs::monitoring::unhealthy.

◆ update_level()

void kcenon::pacs::monitoring::health_status::update_level ( )
inlinenoexcept

Calculate overall health level from component status.

Health level determination:

  • healthy: Database connected AND storage writable AND readable
  • degraded: Database connected but storage issues
  • unhealthy: Database disconnected OR critical failures
Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 247 of file health_status.h.

247 {
248 if (!database.connected) {
250 return;
251 }
252
253 if (!storage.writable || !storage.readable) {
255 return;
256 }
257
258 // Check for degraded conditions
259 if (storage.usage_percent() > 90.0) {
261 return;
262 }
263
267 return;
268 }
269
271 }
@ degraded
Some non-critical components degraded, system operational.
std::uint32_t active_associations
Number of currently active associations.
std::uint32_t max_associations
Maximum concurrent associations allowed.
bool connected
Whether database connection is active.
storage_status storage
Storage subsystem status.
database_status database
Database connection status.
association_metrics associations
DICOM association metrics.
bool writable
Whether storage is writable.
double usage_percent() const noexcept
Storage usage percentage (0-100)
bool readable
Whether storage is readable.

References kcenon::pacs::monitoring::association_metrics::active_associations, associations, kcenon::pacs::monitoring::database_status::connected, database, kcenon::pacs::monitoring::degraded, kcenon::pacs::monitoring::healthy, level, kcenon::pacs::monitoring::association_metrics::max_associations, kcenon::pacs::monitoring::storage_status::readable, storage, kcenon::pacs::monitoring::unhealthy, kcenon::pacs::monitoring::storage_status::usage_percent(), and kcenon::pacs::monitoring::storage_status::writable.

Here is the call graph for this function:

Member Data Documentation

◆ associations

association_metrics kcenon::pacs::monitoring::health_status::associations

DICOM association metrics.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 228 of file health_status.h.

Referenced by update_level().

◆ database

database_status kcenon::pacs::monitoring::health_status::database

Database connection status.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 222 of file health_status.h.

Referenced by update_level().

◆ level

◆ message

std::optional<std::string> kcenon::pacs::monitoring::health_status::message

◆ metrics

storage_metrics kcenon::pacs::monitoring::health_status::metrics

◆ storage

storage_status kcenon::pacs::monitoring::health_status::storage

Storage subsystem status.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 225 of file health_status.h.

Referenced by update_level().

◆ timestamp

std::chrono::system_clock::time_point kcenon::pacs::monitoring::health_status::timestamp
Initial value:
{
std::chrono::system_clock::now()}

Timestamp of this health check.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 218 of file health_status.h.

218 {
219 std::chrono::system_clock::now()};

◆ version

version_info kcenon::pacs::monitoring::health_status::version

Version and uptime information.

Examples
/home/runner/work/pacs_system/pacs_system/include/kcenon/pacs/monitoring/health_status.h.

Definition at line 234 of file health_status.h.


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