Skip to content

hmon: add heartbeat monitor#67

Draft
arkjedrz wants to merge 6 commits intoeclipse-score:mainfrom
qorix-group:arkjedrz_heartbeat-monitor
Draft

hmon: add heartbeat monitor#67
arkjedrz wants to merge 6 commits intoeclipse-score:mainfrom
qorix-group:arkjedrz_heartbeat-monitor

Conversation

@arkjedrz
Copy link
Contributor

@arkjedrz arkjedrz commented Feb 9, 2026

Add heartbeat monitor HMON.

Resolves #68

@arkjedrz arkjedrz requested a review from pawelrutkaq February 9, 2026 15:43
@arkjedrz arkjedrz requested a review from Copilot February 9, 2026 15:43
@github-actions
Copy link

github-actions bot commented Feb 9, 2026

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.4.2) and connecting to it...
INFO: Invocation ID: 66811203-5d14-4916-801d-23bb1c119c4e
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 0 packages loaded
Loading: 0 packages loaded
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Loading: 0 packages loaded
    currently loading: 
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)
Analyzing: target //:license-check (1 packages loaded, 0 targets configured)

Analyzing: target //:license-check (29 packages loaded, 9 targets configured)

Analyzing: target //:license-check (75 packages loaded, 9 targets configured)

Analyzing: target //:license-check (86 packages loaded, 9 targets configured)

Analyzing: target //:license-check (135 packages loaded, 1676 targets configured)

Analyzing: target //:license-check (148 packages loaded, 4933 targets configured)

Analyzing: target //:license-check (149 packages loaded, 5838 targets configured)

Analyzing: target //:license-check (160 packages loaded, 7817 targets configured)

Analyzing: target //:license-check (160 packages loaded, 7817 targets configured)

Analyzing: target //:license-check (160 packages loaded, 7817 targets configured)

Analyzing: target //:license-check (164 packages loaded, 9829 targets configured)

INFO: Analyzed target //:license-check (165 packages loaded, 9955 targets configured).
[12 / 16] [Prepa] JavaToolchainCompileClasses external/rules_java+/toolchains/platformclasspath_classes
[14 / 16] JavaToolchainCompileBootClasspath external/rules_java+/toolchains/platformclasspath.jar; 0s disk-cache, processwrapper-sandbox
[15 / 16] Building license.check.license_check.jar (); 0s disk-cache, multiplex-worker
INFO: Found 1 target...
Target //:license.check.license_check up-to-date:
  bazel-bin/license.check.license_check
  bazel-bin/license.check.license_check.jar
INFO: Elapsed time: 32.019s, Critical Path: 2.44s
INFO: 16 processes: 12 internal, 3 processwrapper-sandbox, 1 worker.
INFO: Build completed successfully, 16 total actions
INFO: Running command line: bazel-bin/license.check.license_check ./formatted.txt <args omitted>
usage: org.eclipse.dash.licenses.cli.Main [-batch <int>] [-cd <url>]
       [-confidence <int>] [-ef <url>] [-excludeSources <sources>] [-help] [-lic
       <url>] [-project <shortname>] [-repo <url>] [-review] [-summary <file>]
       [-timeout <seconds>] [-token <token>]

@github-actions
Copy link

github-actions bot commented Feb 9, 2026

The created documentation from the pull request is available at: docu-html

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a new heartbeat monitor (HMON) to the Rust health monitoring library and integrates it into the existing monitoring worker/supervisor notification flow.

Changes:

  • Introduces heartbeat module (monitor + atomic state) and integrates heartbeat monitors into HealthMonitorBuilder/HealthMonitor.
  • Updates the monitor evaluation interface to accept a shared hmon_starting_point and wires it through the monitoring worker thread.
  • Refactors SupervisorAPIClient into a dedicated module with selectable implementations via Cargo features.

Reviewed changes

Copilot reviewed 13 out of 14 changed files in this pull request and generated 10 comments.

Show a summary per file
File Description
src/health_monitoring_lib/rust/worker.rs Passes a shared HMON start instant into monitor evaluations; moves supervisor client trait out.
src/health_monitoring_lib/rust/supervisor_api_client/mod.rs Adds feature-selected SupervisorAPIClient + implementation alias.
src/health_monitoring_lib/rust/supervisor_api_client/stub_supervisor_api_client.rs New stub client implementation.
src/health_monitoring_lib/rust/supervisor_api_client/score_supervisor_api_client.rs New SCORE client implementation.
src/health_monitoring_lib/rust/lib.rs Adds heartbeat monitors to builder + start flow; uses new supervisor client impl selector.
src/health_monitoring_lib/rust/heartbeat/mod.rs Exposes heartbeat monitor API.
src/health_monitoring_lib/rust/heartbeat/heartbeat_state.rs Adds atomic packed heartbeat state and tests.
src/health_monitoring_lib/rust/heartbeat/heartbeat_monitor.rs Implements heartbeat monitor logic + tests (incl. loom).
src/health_monitoring_lib/rust/deadline/deadline_monitor.rs Adapts deadline evaluation to new evaluator signature and shared start instant.
src/health_monitoring_lib/rust/common.rs Extends evaluation error types; adds duration_to_u32; updates evaluator trait signature.
src/health_monitoring_lib/Cargo.toml Adds optional monitor_rs, loom target dep, and feature defaults.
src/health_monitoring_lib/BUILD Enables score_supervisor_api_client feature in Bazel builds.
Cargo.toml Updates workspace defaults and adds cfg(loom) lint configuration.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from f07c0db to e65f6a6 Compare February 10, 2026 11:43
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 10, 2026 11:43 — with GitHub Actions Inactive
@arkjedrz arkjedrz requested a review from Copilot February 10, 2026 11:44
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from e65f6a6 to bd438c3 Compare February 10, 2026 12:57
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 10, 2026 12:57 — with GitHub Actions Inactive
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from bd438c3 to c5f4b84 Compare February 10, 2026 13:14
@arkjedrz arkjedrz requested a review from Copilot February 10, 2026 13:15
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 3 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from c5f4b84 to b012f37 Compare February 10, 2026 13:19
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 10, 2026 13:19 — with GitHub Actions Inactive
@arkjedrz arkjedrz requested a review from Copilot February 10, 2026 13:19
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 15 out of 16 changed files in this pull request and generated 4 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from b012f37 to 862da21 Compare February 11, 2026 12:14
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 11, 2026 12:14 — with GitHub Actions Inactive
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from 862da21 to 59c92ee Compare February 13, 2026 14:48
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 13, 2026 14:48 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 13, 2026 14:48 — with GitHub Actions Inactive
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from 59c92ee to cf14efb Compare February 17, 2026 12:12
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 17, 2026 12:12 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 17, 2026 12:12 — with GitHub Actions Inactive
@arkjedrz arkjedrz self-assigned this Feb 17, 2026
- Fix Cargo for `health_monitoring_lib`.
- Fix leftover test changes from previous PR.
- Small code changes.
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 17 out of 18 changed files in this pull request and generated 4 comments.

Comments suppressed due to low confidence (1)

src/health_monitoring_lib/rust/worker.rs:126

  • next_sleep_time = interval - now.elapsed() can panic if the loop body takes longer than interval (or the thread is delayed), because Duration subtraction underflows. Use interval.saturating_sub(now.elapsed()) (and optionally log when the cycle is overrun) to avoid crashing the monitoring thread under load.
                        break;
                    }

                    next_sleep_time = interval - now.elapsed();
                }

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

- Less restrictive feature flags.
- Additional small code changes.
- Remove unnecessary abstraction from monitors.
- Improve docs.
- Move `FFIBorrowed` and `FFIHandle` to main `ffi` module.
- Small esthetics fixes.
- Restore some parts.
- Separate errors into groups.
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from 67fe6cc to 806a239 Compare February 25, 2026 13:08
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 25, 2026 13:08 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 25, 2026 13:08 — with GitHub Actions Inactive
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from 806a239 to 50a33ae Compare February 26, 2026 07:13
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from 50a33ae to 3365dc5 Compare February 26, 2026 10:42
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 26, 2026 10:42 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 26, 2026 10:42 — with GitHub Actions Inactive
- Add `HealthMonitorError`.
  - Not fully utilized in this change, required for future monitors.
- Simplify implementation of `start` and `build`.
  - No longer must be reimplemented for FFI.
- New unit tests for `lib.rs`.
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from 3365dc5 to a6a4166 Compare February 26, 2026 12:39
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 26, 2026 12:39 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 26, 2026 12:39 — with GitHub Actions Inactive
Add heartbeat monitor HMON.
@arkjedrz arkjedrz force-pushed the arkjedrz_heartbeat-monitor branch from a6a4166 to a1e6154 Compare February 26, 2026 13:57
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 26, 2026 13:57 — with GitHub Actions Inactive
@arkjedrz arkjedrz temporarily deployed to workflow-approval February 26, 2026 13:57 — with GitHub Actions Inactive
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.

[HmLib] Rust Heartbeat Monitor API

2 participants