Skip to content

refactor: improve memory usage reporting - #18

Merged
riki137 merged 2 commits into
masterfrom
memory-usage-improvement
Mar 9, 2026
Merged

refactor: improve memory usage reporting#18
riki137 merged 2 commits into
masterfrom
memory-usage-improvement

Conversation

@riki137

@riki137 riki137 commented Mar 9, 2026

Copy link
Copy Markdown
Owner

No description provided.

@codecov

codecov Bot commented Mar 9, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 93.93939% with 2 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/Orchestrator/Output/SystemMemoryReader.php 93.10% 2 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors table output memory reporting by extracting system-level memory probing into a dedicated SystemMemoryReader, improving compatibility with environments where ps -p is unsupported (e.g., BusyBox).

Changes:

  • Added SystemMemoryReader to read RSS from /proc/<pid>/status (preferred) with fallback to ps and finally memory_get_usage(true).
  • Updated TableOutput (and factory wiring) to use SystemMemoryReader for current process usage and free-memory checks.
  • Added unit tests for SystemMemoryReader and updated the changelog.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
tests/Unit/SystemMemoryReaderTest.php Adds unit coverage for proc/ps/php-fallback memory probing behavior.
src/Orchestrator/Output/TableOutputFactory.php Wires SystemMemoryReader into TableOutput creation.
src/Orchestrator/Output/TableOutput.php Replaces inline memory probing with SystemMemoryReader.
src/Orchestrator/Output/SystemMemoryReader.php Implements centralized system memory probing logic.
CHANGELOG.md Documents the refactor and BusyBox fix.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/Unit/SystemMemoryReaderTest.php
Comment thread src/Orchestrator/Output/SystemMemoryReader.php
@riki137
riki137 merged commit 25c741e into master Mar 9, 2026
14 checks passed
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.

2 participants