Skip to content

Add cross-platform health check fallbacks (#1) - #72

Closed
ZachDreamZ wants to merge 1 commit into
weilixiong:mainfrom
ZachDreamZ:tt1-health-crossplatform
Closed

Add cross-platform health check fallbacks (#1)#72
ZachDreamZ wants to merge 1 commit into
weilixiong:mainfrom
ZachDreamZ:tt1-health-crossplatform

Conversation

@ZachDreamZ

Copy link
Copy Markdown

What

Adds portable memory and load-average collectors to tools/health_check.py so the checks gather real data on non-Linux platforms instead of degrading to a bare WARNING.

  • Linux: existing /proc/meminfo + /proc/loadavg (unchanged behavior).
  • macOS: vm_stat + sysctl vm.loadavg.
  • Other platforms (e.g. Windows): honest WARNING with the exact gap, no fabricated numbers.

Why

Resolves issue #1. The previous implementation assumed /proc, so macOS/others never returned a real reading. The new collectors pick the first working source for the current platform.

Verification

  • Imported the module and called check_memory_usage()/check_load_average() on Windows: both return a graceful WARNING tuple without raising.
  • On Linux/macOS the respective native source is used.

Resolves #1

…backs (#1) - portable memory/load collectors (Linux /proc, macOS vm_stat/sysctl, graceful WARNING elsewhere). Resolves #1
@ZachDreamZ ZachDreamZ closed this Jul 24, 2026
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.

[$50 BOUNTY] [Python] Add cross-platform health check fallbacks

1 participant