Skip to content

Fix health checks: Add cross-platform memory and load average check fallbacks#13

Open
Samarth1306w wants to merge 1 commit into
weilixiong:mainfrom
Samarth1306w:fix-health-fallback
Open

Fix health checks: Add cross-platform memory and load average check fallbacks#13
Samarth1306w wants to merge 1 commit into
weilixiong:mainfrom
Samarth1306w:fix-health-fallback

Conversation

@Samarth1306w

Copy link
Copy Markdown

Description

Added cross-platform fallbacks for check_memory_usage() and check_load_average() to support environments without /proc/meminfo and /proc/loadavg files (e.g. macOS/Darwin, Windows).

Changes

  • Modified check_memory_usage() to fall back to sysctl and vm_stat parsing on macOS/Darwin, and ctypes (kernel32.GlobalMemoryStatusEx) on Windows.
  • Modified check_load_average() to fall back to os.getloadavg() where available (e.g., macOS/Darwin).
  • Implemented unit tests in tools/test_health_check_fallback.py to assert memory and load check fallback functions by mocking missing /proc files and matching host output structures.
  • Patched compilation scripts to map Android/Termux environments to Linux configurations.
  • Included the generated diagnostic logs and build metadata under diagnostic/.

/claim #1

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