hmon: add C++ interface to heartbeat monitor#72
Merged
arkjedrz merged 1 commit intoeclipse-score:mainfrom Mar 6, 2026
Merged
Conversation
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 |
04a90a3 to
93f7fc7
Compare
93f7fc7 to
b3753a6
Compare
b3753a6 to
89ad2f1
Compare
578964b to
8c150e1
Compare
8c150e1 to
0104ab2
Compare
0104ab2 to
c6e4454
Compare
c6e4454 to
602b860
Compare
602b860 to
eff29f5
Compare
eff29f5 to
9d1ba1c
Compare
There was a problem hiding this comment.
Pull request overview
This PR adds a new Heartbeat monitor to the health monitoring library and exposes it through the existing C++ API surface (via Rust FFI), integrating it into the HealthMonitor build/start workflow.
Changes:
- Introduces a Rust
HeartbeatMonitor(state, evaluation logic, builder) plus FFI exports for C++. - Extends
HealthMonitorBuilder/HealthMonitorto store, retrieve, and start heartbeat monitors alongside deadline monitors. - Adds C++ wrapper types, wiring in
HealthMonitorBuilder::add_heartbeat_monitor/HealthMonitor::get_heartbeat_monitor, and updates C++ tests/build.
Reviewed changes
Copilot reviewed 15 out of 15 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| src/health_monitoring_lib/rust/worker.rs | Passes a shared HMON starting Instant into monitor evaluation and logs heartbeat evaluation errors. |
| src/health_monitoring_lib/rust/lib.rs | Adds heartbeat monitor storage/build/retrieval and includes heartbeat monitors when starting the worker. |
| src/health_monitoring_lib/rust/heartbeat/mod.rs | Introduces the heartbeat module exports and FFI submodule. |
| src/health_monitoring_lib/rust/heartbeat/heartbeat_state.rs | Adds packed atomic heartbeat state representation plus unit tests. |
| src/health_monitoring_lib/rust/heartbeat/heartbeat_monitor.rs | Implements heartbeat monitor builder, evaluation logic, and tests (incl. loom tests). |
| src/health_monitoring_lib/rust/heartbeat/ffi.rs | Adds FFI functions for heartbeat builder creation/destruction and sending heartbeats from C++. |
| src/health_monitoring_lib/rust/ffi.rs | Adds FFI to register heartbeat monitors with the HMON builder and to retrieve heartbeat monitors. |
| src/health_monitoring_lib/rust/deadline/deadline_monitor.rs | Updates evaluator signature and reuses shared time conversion helper. |
| src/health_monitoring_lib/rust/common.rs | Extends MonitorEvaluator to include an HMON starting point and adds time helpers used by heartbeat. |
| src/health_monitoring_lib/cpp/tests/health_monitor_test.cpp | Extends the C++ test to build/get/use a heartbeat monitor. |
| src/health_monitoring_lib/cpp/include/score/hm/heartbeat/heartbeat_monitor.h | Adds the C++ heartbeat monitor and builder API declarations. |
| src/health_monitoring_lib/cpp/include/score/hm/health_monitor.h | Adds heartbeat monitor inclusion and retrieval APIs to C++ HMON. |
| src/health_monitoring_lib/cpp/heartbeat_monitor.cpp | Implements the C++ heartbeat wrapper over Rust FFI calls. |
| src/health_monitoring_lib/cpp/health_monitor.cpp | Wires heartbeat monitor builder/getter calls through to the Rust FFI. |
| src/health_monitoring_lib/BUILD | Adds the new C++ heartbeat source/header to the build. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
9d1ba1c to
046bcf4
Compare
Contributor
|
Dont review this one before #67 is merged as this is based on it. |
046bcf4 to
542ad99
Compare
542ad99 to
3da944a
Compare
3da944a to
64358a6
Compare
64358a6 to
92c2ac4
Compare
NicolasFussberger
approved these changes
Mar 6, 2026
Add C++ interface to heartbeat monitor.
92c2ac4 to
59c49aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add C++ interface to heartbeat monitor.
Resolves #69