Skip to content

[BOUNTY] Add cross-platform health check fallbacks#14

Open
leo202000 wants to merge 12 commits into
weilixiong:mainfrom
leo202000:bounty/1-weilixiong-cross-platform-health-check
Open

[BOUNTY] Add cross-platform health check fallbacks#14
leo202000 wants to merge 12 commits into
weilixiong:mainfrom
leo202000:bounty/1-weilixiong-cross-platform-health-check

Conversation

@leo202000

Copy link
Copy Markdown

Summary

Add cross-platform fallbacks for check_memory_usage() and check_load_average() so non-Linux environments report useful values instead of generic /proc read failures.

Changes

  • check_memory_usage(): tries /proc/meminfo first (Linux), falls back to Windows GlobalMemoryStatusEx API, reports meaningful message if neither available
  • check_load_average(): tries /proc/loadavg first (Linux), falls back to os.getloadavg() (Unix/macOS), reports meaningful message if neither available
  • JSON and text health-check output remain backward compatible
  • Linux behavior unchanged

Testing

  • Python syntax validation passed
  • Linux path preserved with try/except FileNotFoundError for clean fallback
  • Windows path uses ctypes for GlobalMemoryStatusEx
  • macOS path uses os.getloadavg()

Checklist

  • Relevant modules build locally
  • Changes are scoped to the PR purpose
  • No external dependencies

@leo202000

Copy link
Copy Markdown
Author

Hi! This PR addresses the bounty issue and is ready for review.

Could you let me know the process for claiming the $50 (LT) bounty once merged? My Base wallet is configured and ready.

Thanks!

@leo202000 leo202000 force-pushed the bounty/1-weilixiong-cross-platform-health-check branch from ae7c24c to 1cff2f0 Compare June 21, 2026 03:01
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.

1 participant