Skip to content

feat(health): implement health monitoring API for test_health_monitoring.cpp#356

Merged
kcenon merged 4 commits into
mainfrom
feature/issue-330-health-monitoring-api
Jan 9, 2026
Merged

feat(health): implement health monitoring API for test_health_monitoring.cpp#356
kcenon merged 4 commits into
mainfrom
feature/issue-330-health-monitoring-api

Conversation

@kcenon

@kcenon kcenon commented Jan 9, 2026

Copy link
Copy Markdown
Owner

Summary

New Classes and Components

Component Description
health_check Abstract base class with get_name(), get_type(), check(), get_timeout(), is_critical()
functional_health_check Lambda-based health check implementation
composite_health_check Aggregates multiple health checks with all-required or any-required semantics
health_dependency_graph DAG for health check dependencies with cycle detection, topological sort, failure impact analysis
health_check_builder Builder pattern for fluent API health check creation
health_monitor_stats Statistics tracking for health monitoring

Extended health_monitor Methods

  • register_check(name, check) -> result<bool>
  • unregister_check(name) -> result<bool>
  • check(name) -> result<health_check_result>
  • add_dependency(dependent, dependency) -> result<bool>
  • start() -> result_void
  • stop() -> result_void
  • is_running() -> bool
  • refresh()
  • register_recovery_handler(name, handler)
  • get_stats() -> health_monitor_stats
  • get_health_report() -> string

New Functions

  • global_health_monitor() - Singleton accessor for global health monitor

Test Plan

  • Build passes with cmake --build . --parallel 8
  • All 22 health monitoring tests pass
  • Run ./tests/monitoring_system_tests --gtest_filter="HealthMonitoringTest.*"

Changes

  • include/kcenon/monitoring/health/health_monitor.h - Implemented full health monitoring API
  • tests/test_health_monitoring.cpp - Enabled include and tests
  • tests/CMakeLists.txt - Enabled test_health_monitoring.cpp
  • docs/CHANGELOG.md - Added health monitoring API entry
  • docs/CHANGELOG_KO.md - Added Korean translation
  • docs/KNOWN_ISSUES.md - Updated test status and API stability

Closes #330

kcenon added 4 commits January 9, 2026 09:38
…ing.cpp

Implement comprehensive health monitoring API as defined in Issue #330:

- health_check: Abstract base class for health checks with get_name(),
  get_type(), check(), get_timeout(), and is_critical() methods
- composite_health_check: Aggregates multiple health checks with
  configurable all-required or any-required semantics
- health_dependency_graph: DAG structure for health check dependencies
  with cycle detection, topological sort, failure impact analysis
- health_check_builder: Builder pattern for creating functional health
  checks with fluent API
- health_monitor: Extended with register_check(), unregister_check(),
  check(), add_dependency(), start()/stop(), get_stats(), get_health_report()
- health_monitor_stats: Statistics tracking for health monitoring
- global_health_monitor(): Singleton accessor for global health monitor

All 22 tests in test_health_monitoring.cpp pass successfully.

Closes #330
- Add health monitoring API entry to CHANGELOG.md and CHANGELOG_KO.md
- Update KNOWN_ISSUES.md:
  - Remove test_health_monitoring.cpp from disabled tests
  - Add test_health_monitoring.cpp to recently enabled tests
  - Add Health Monitor to API stability table as Stable
- Change shared_lock to lock_guard in check(), check_all(), and refresh()
  methods since they modify cached_results_ and stats_
- Add missing <condition_variable> header required for cv_ member
- Add thread-safe status handling in test_health_check with atomic status
  and mutex protection for message member
- Add <atomic> and <mutex> headers to test file

Fixes thread sanitizer and undefined behavior sanitizer failures:
- HealthMonitoringTest.HealthMonitorOverallStatus
- HealthMonitoringTest.HealthMonitorStats
- HealthMonitoringTest.HealthMonitorReport
- HealthMonitoringTest.ConcurrentHealthChecks
Document the health_monitor thread safety fixes in both English and
Korean CHANGELOG files for PR #356.
@kcenon kcenon merged commit 81ad258 into main Jan 9, 2026
21 checks passed
@kcenon kcenon deleted the feature/issue-330-health-monitoring-api branch January 9, 2026 01:26
kcenon added a commit that referenced this pull request Apr 13, 2026
…ing.cpp (#356)

* feat(health): implement health monitoring API for test_health_monitoring.cpp

Implement comprehensive health monitoring API as defined in Issue #330:

- health_check: Abstract base class for health checks with get_name(),
  get_type(), check(), get_timeout(), and is_critical() methods
- composite_health_check: Aggregates multiple health checks with
  configurable all-required or any-required semantics
- health_dependency_graph: DAG structure for health check dependencies
  with cycle detection, topological sort, failure impact analysis
- health_check_builder: Builder pattern for creating functional health
  checks with fluent API
- health_monitor: Extended with register_check(), unregister_check(),
  check(), add_dependency(), start()/stop(), get_stats(), get_health_report()
- health_monitor_stats: Statistics tracking for health monitoring
- global_health_monitor(): Singleton accessor for global health monitor

All 22 tests in test_health_monitoring.cpp pass successfully.

Closes #330

* docs: update documentation for health monitoring API

- Add health monitoring API entry to CHANGELOG.md and CHANGELOG_KO.md
- Update KNOWN_ISSUES.md:
  - Remove test_health_monitoring.cpp from disabled tests
  - Add test_health_monitoring.cpp to recently enabled tests
  - Add Health Monitor to API stability table as Stable

* fix(health): resolve thread safety issues in health_monitor

- Change shared_lock to lock_guard in check(), check_all(), and refresh()
  methods since they modify cached_results_ and stats_
- Add missing <condition_variable> header required for cv_ member
- Add thread-safe status handling in test_health_check with atomic status
  and mutex protection for message member
- Add <atomic> and <mutex> headers to test file

Fixes thread sanitizer and undefined behavior sanitizer failures:
- HealthMonitoringTest.HealthMonitorOverallStatus
- HealthMonitoringTest.HealthMonitorStats
- HealthMonitoringTest.HealthMonitorReport
- HealthMonitoringTest.ConcurrentHealthChecks

* docs: add thread safety fix to changelog

Document the health_monitor thread safety fixes in both English and
Korean CHANGELOG files for PR #356.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[TEST] Implement health monitoring API for test_health_monitoring.cpp (ARC-001 Phase 1)

1 participant