Skip to content

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

Open
liujin11112 wants to merge 4 commits into
weilixiong:mainfrom
liujin11112:fix/cross-platform-health-check
Open

[$50 BOUNTY] [Python] Add cross-platform health check fallbacks#21
liujin11112 wants to merge 4 commits into
weilixiong:mainfrom
liujin11112:fix/cross-platform-health-check

Conversation

@liujin11112

Copy link
Copy Markdown

Summary

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

Changes

  • tools/health_check.py:
    • check_memory_usage(): Keeps Linux /proc/meminfo path; adds macOS fallback via vm_stat+sysctl; adds Windows fallback via GlobalMemoryStatusEx
    • check_load_average(): Keeps Linux /proc/loadavg path; adds macOS/Unix fallback via os.getloadavg(); returns informative WARNING on Windows
  • tests/test_health_check.py: 9 unit tests covering cross-platform memory and load fallback behavior

Testing

python -m unittest tests.test_health_check -v
# Result: 9/9 tests passed

Checklist

  • Relevant modules affected by these changes build locally
  • Tests pass locally
  • Diagnostic build log is committed in this PR

@liujin11112

Copy link
Copy Markdown
Author

Hi, this PR adds cross-platform fallbacks for memory and load checks on macOS and Windows while keeping Linux behavior unchanged.

I can receive payment via:

  • PayPal
  • USDT (TRC20)
  • BTC

Please let me know which works best. Thanks!

@liujin11112

Copy link
Copy Markdown
Author

Hi, just checking in on this PR. Is there anything else needed from my side to move this forward? The code changes + tests are ready. Happy to make any adjustments. Thanks!

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