[ BOUNTY] [Python] Add cross-platform health check fallbacks#12
Open
Xiaofei-Z wants to merge 2 commits into
Open
[ BOUNTY] [Python] Add cross-platform health check fallbacks#12Xiaofei-Z wants to merge 2 commits into
Xiaofei-Z wants to merge 2 commits into
Conversation
added 2 commits
June 19, 2026 22:22
Closes weilixiong#1 - check_memory_usage(): /proc/meminfo on Linux, vm_stat on macOS, psutil as generic fallback - check_load_average(): /proc/loadavg on Linux, os.getloadavg() on Unix, psutil on Windows - Non-Linux environments now report useful values instead of generic /proc read failures - 10 tests covering Linux path, fallback paths, missing /proc simulation, macOS behavior - JSON and text output backward compatible
Author
|
Hi @weilixiong, submitted this for bounty #1. Adds cross-platform fallbacks: /proc/meminfo on Linux, vm_stat on macOS, psutil generic for memory; /proc/loadavg on Linux, os.getloadavg() on Unix, psutil on Windows for load average. 10 tests pass, build diagnostics included. Happy to address feedback! |
yanyishuai
added a commit
to yanyishuai/TentOfTrials
that referenced
this pull request
Jul 2, 2026
yanyishuai
added a commit
to yanyishuai/TentOfTrials
that referenced
this pull request
Jul 2, 2026
yanyishuai
added a commit
to yanyishuai/TentOfTrials
that referenced
this pull request
Jul 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds cross-platform fallbacks for
check_memory_usage()andcheck_load_average()so non-Linux environments report useful values instead of generic/procread failures.Changes
tools/health_check.py:check_memory_usage():/proc/meminfoon Linux →vm_stat+sysctlon macOS →psutilas generic fallbackcheck_load_average():/proc/loadavgon Linux →os.getloadavg()on Unix →psutilon Windowstests/test_cross_platform_health.py: 10 tests covering Linux path simulation, fallback paths, missing/procsimulation, macOS behaviorTesting
Fallback behavior:
/proc/meminfoand/proc/loadavg(unchanged, backward compatible)vm_stat+sysctl hw.memsizefor memory;os.getloadavg()for loadpsutilif available, otherwise graceful WARNINGTest coverage:
/procfiles/procfiles produce WARNING with error detailBuild validation:
Diagnostic artifacts:
diagnostic/build-9659efd1-part001..004.logd+diagnostic/build-9659efd1-metadata.jsonDiagnostic password:
cbc7af3146d522ee68f0Checklist