Skip to content

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

Description

@weilixiong

Bounty: $50 (LT)

Area: tools/health_check.py

Current state: The health check tool reads Linux-only /proc/meminfo and /proc/loadavg directly for memory and load checks. On macOS or other non-Linux environments those checks degrade to warning-only results even though Python standard-library fallbacks can still provide useful diagnostics.

What's needed: Add cross-platform fallbacks for the memory and load checks so non-Linux environments report useful values instead of generic /proc read failures. Keep the Linux behavior compatible with the current output.

Acceptance criteria:

  • check_memory_usage() keeps the existing /proc/meminfo path on Linux but has a non-Linux fallback that returns a meaningful status/detail tuple.
  • check_load_average() keeps the existing /proc/loadavg path where available but falls back to os.getloadavg() or another standard-library path where possible.
  • Add focused tests or a small validation path that simulates missing /proc files and verifies fallback behavior.
  • JSON and text health-check output remain backward compatible for existing callers.
  • PR description explains the fallback behavior and validation performed.

Required validation:

  • Run python3 build.py
  • Include the generated diagnostic .logd artifact from diagnostic/build-XXX.logd in the PR; also include diagnostic/build-XXX.json if present
  • Use .github/pull_request_template.md for your submission

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions