hmon: rework Rust structure, align interfaces#102
hmon: rework Rust structure, align interfaces#102arkjedrz wants to merge 2 commits intoeclipse-score:mainfrom
Conversation
arkjedrz
commented
Mar 3, 2026
- Move HMON to a separate module.
- Align Rust and C++ interfaces.
License Check Results🚀 The license check job ran with the Bazel command: bazel run --lockfile_mode=error //:license-checkStatus: Click to expand output |
|
The created documentation from the pull request is available at: docu-html |
34a40cf to
5bca3e2
Compare
5bca3e2 to
d27ae8f
Compare
d27ae8f to
5de7e39
Compare
5de7e39 to
b23aea9
Compare
b23aea9 to
a3838c7
Compare
There was a problem hiding this comment.
Pull request overview
This PR restructures the health monitoring library by moving HealthMonitor, HealthMonitorBuilder, and HealthMonitorError from lib.rs into a dedicated health_monitor.rs module, adds logic monitor FFI bindings (Rust + C++), and aligns the C++ API to use expected return types instead of assertions for build() and start().
Changes:
- Extracted
HealthMonitor/HealthMonitorBuilderintohealth_monitor.rsmodule; updated all import paths accordingly. - Added full logic monitor FFI layer:
LogicMonitorBuilderandLogicMonitorC++ classes with Rust FFI bindings, includingStateTagC++ type. - Changed C++
HealthMonitorBuilder::build()andHealthMonitor::start()to returnexpectedtypes instead of asserting on failure.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
rust/lib.rs |
Moved HealthMonitor code to health_monitor.rs, re-exports types |
rust/health_monitor.rs |
New module containing HealthMonitor/Builder/Error (moved from lib.rs) |
rust/logic/mod.rs |
Exposes new ffi submodule |
rust/logic/ffi.rs |
New FFI bindings for logic monitor builder/monitor |
rust/logic/logic_monitor.rs |
Updated import paths |
rust/ffi.rs |
Added health_monitor_builder_add_logic_monitor and health_monitor_get_logic_monitor FFI functions + tests |
rust/worker.rs |
Updated import paths |
rust/deadline/*.rs |
Updated import paths |
rust/heartbeat/heartbeat_monitor.rs |
Updated import paths |
cpp/logic_monitor.cpp |
New C++ implementation for LogicMonitorBuilder/LogicMonitor |
cpp/include/score/hm/logic/logic_monitor.h |
New C++ header for logic monitor types |
cpp/include/score/hm/tag.h |
Added default Tag() constructor and StateTag class |
cpp/include/score/hm/health_monitor.h |
Added logic monitor methods, changed build/start return types |
cpp/health_monitor.cpp |
Implemented logic monitor integration, error-returning build/start |
cpp/tests/health_monitor_test.cpp |
Updated test for new API |
examples/cpp_supervised_app/main.cpp |
Updated for new expected-returning API |
BUILD |
Added logic_monitor source/header |
.vscode/settings.json |
Added noDefaultFeatures setting |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
src/health_monitoring_lib/cpp/include/score/hm/logic/logic_monitor.h
Outdated
Show resolved
Hide resolved
- Move HMON to a separate module. - Align Rust and C++ interfaces.
a3838c7 to
136d587
Compare
Restore previous behavior that `start` can cause panic/abort.