Add per-process disk I/O read and write speed to process management#1179
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (2)
📝 WalkthroughWalkthroughThis PR extends process monitoring to collect per-process disk I/O read/write counters and compute transfer speeds from sample deltas. Windows and Unix collection scripts were updated to emit I/O counters. The Proc model now includes nullable readBytes, writeBytes, readSpeed, and writeSpeed; PsResult carries sampledAtMillis and can accept a previous sample for elapsed-time-based speed computation. The process UI passes previous results to parsing, prunes read/write sort modes if I/O data is absent, and displays formatted speed metrics. Tests were added/expanded for parsing, speed calculation, rollback handling, and sorting. Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (1)
lib/view/page/process.dart (1)
183-234: ⚡ Quick winSplit these UI helpers into
extension on _ProcessPageStatesections (Widget/Actions/Utils).The new trail rendering and formatter are still embedded in the state class. Please align with the view-layer structure rule for extension-based splitting.
As per coding guidelines: "Split UI into Widget build, Actions, Utils using
extension onto achieve this pattern".🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@lib/view/page/process.dart` around lines 183 - 234, The _buildItemTrail widget and _formatSpeed utility are still inside the state class; extract them into extension blocks to follow the Widget/Actions/Utils split: move the _buildItemTrail(Proc proc) implementation into an extension on _ProcessPageState dedicated to Widgets (e.g., extension on _ProcessPageState { Widget _buildItemTrail(Proc proc) { ... } }), place any action-related helpers (if present in this region) into an Actions extension, and move _formatSpeed(double) into a Utils extension (e.g., extension on _ProcessPageState { String _formatSpeed(double bytes) => ... }), keeping all references to _client, _refresh, context.showRoundDialog, etc., unchanged so callers in _ProcessPageState continue to work.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@lib/data/model/app/scripts/script_builders.dart`:
- Around line 260-265: The shell snippet uses an unquoted set -- $line which
allows pathname expansion (globbing) on ps args; to fix, wrap the set call with
temporary globbing disabled: call set -f before set -- $line and restore with
set +f after (i.e., insert set -f; set -- $line; set +f) so fields split as
before but wildcard expansion cannot alter the COMMAND; update the code around
the existing ps ... | while IFS= read -r line; do block and keep other variables
(pid, user, cpu, ... cmd) unchanged.
---
Nitpick comments:
In `@lib/view/page/process.dart`:
- Around line 183-234: The _buildItemTrail widget and _formatSpeed utility are
still inside the state class; extract them into extension blocks to follow the
Widget/Actions/Utils split: move the _buildItemTrail(Proc proc) implementation
into an extension on _ProcessPageState dedicated to Widgets (e.g., extension on
_ProcessPageState { Widget _buildItemTrail(Proc proc) { ... } }), place any
action-related helpers (if present in this region) into an Actions extension,
and move _formatSpeed(double) into a Utils extension (e.g., extension on
_ProcessPageState { String _formatSpeed(double bytes) => ... }), keeping all
references to _client, _refresh, context.showRoundDialog, etc., unchanged so
callers in _ProcessPageState continue to work.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Repository UI
Review profile: CHILL
Plan: Pro
Run ID: 2a85597c-5e94-4e48-8c61-251d253756b0
📒 Files selected for processing (6)
lib/data/model/app/scripts/script_builders.dartlib/data/model/server/proc.dartlib/data/res/github_id.dartlib/view/page/process.dartpackages/dartssh2test/proc_test.dart
#1175 #1178
Summary
Testing
dart analyzepassed for the touched Dart model, UI, and script builder files.dart test test/proc_test.dartpassed with coverage for legacy process parsing plus the new IO speed scenarios.Summary by CodeRabbit
New Features
Tests