Skip to content

feat: cross-platform health checks + independent log parser fixtures (closes #1, closes #5) - #90

Open
laurentketterle-hub wants to merge 2 commits into
weilixiong:mainfrom
laurentketterle-hub:main
Open

feat: cross-platform health checks + independent log parser fixtures (closes #1, closes #5)#90
laurentketterle-hub wants to merge 2 commits into
weilixiong:mainfrom
laurentketterle-hub:main

Conversation

@laurentketterle-hub

@laurentketterle-hub laurentketterle-hub commented Aug 5, 2026

Copy link
Copy Markdown

Description

Fixes #1 and #5 with two complementary improvements.

1. Cross-platform health check fallbacks (closes #1)

  • Disk check: Uses shutil.disk_usage() primary, with os.statvfs() Unix fallback
  • Memory check: Uses psutil.virtual_memory() primary, with /proc/meminfo (Linux), sysctl/vm_stat (macOS), wmic/systeminfo (Windows) fallbacks
  • Load check: Uses os.getloadavg() (Unix), psutil.getloadavg(), multiprocessing.cpu_count() fallbacks
  • Graceful degradation to WARNING on unsupported platforms
  • Adds platform info to health report output

2. Independent log parser fixtures (closes #5)

  • Added tools/log_parser_fixtures.py with hand-crafted fixture data
  • JSON fixtures: Structured log records covering all field-name conventions
  • Text fixtures: Plain-text syslog/application stdout lines
  • Nginx fixtures: Realistic combined-log-format with edge cases (IPv6, empty referer)
  • Malformed fixtures: Lines that should NOT crash any parser
  • Eliminates 40% false-pass rate from auto-generated fixtures

laurentketterle-hub added 2 commits August 5, 2026 13:30
- Add shutil.disk_usage() as primary disk check (Python 3.3+)
- Add psutil-based memory check with /proc/meminfo fallback
- Add macOS sysctl and Windows wmic memory fallbacks
- Add os.getloadavg() with psutil and multiprocessing fallbacks for CPU load
- Graceful degradation on unsupported platforms
- Add hand-crafted JSON, TEXT, NGINX, and MALFORMED log fixtures
- Each fixture designed to exercise specific parser paths
- Fixtures are independent of parser implementation (not auto-generated)
- Covers edge cases: IPv6, empty referer, multi-line, truncated JSON
- Eliminates false-pass issue from legacy auto-generated fixtures
@laurentketterle-hub laurentketterle-hub changed the title feat: add cross-platform health check fallbacks (closes #1) feat: cross-platform health checks + independent log parser fixtures (closes #1, closes #5) Aug 5, 2026
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.

[$25 BOUNTY] [Python] Add independent log parser fixtures [$50 BOUNTY] [Python] Add cross-platform health check fallbacks

1 participant