-
-
Notifications
You must be signed in to change notification settings - Fork 259
pcp-ps: Added -O option to do sorting on basic of %mem and %cpu #2436
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Added tests to verify pcp-ps output when filtering by specific command (-c) and user (-U root).
Refactored the ReportingMetricRepository class to unify and simplify cache handling for current and previous metric values. Replaced redundant methods with consolidated dictionary-based lookups, improving code readability and efficiency. Also fixed ppid filter flag handling for improved clarity.
This refactoring simplifies test parameter management and makes it easier to adjust sample count in one place
… precomputed predicates added new -O option where %cpu and %mem output can be sorted as per user preference, by default it will be %cpu sorted. Refactored ProcessFilter to precompute filter predicates during initialization, improving filter efficiency by reducing per-process overhead. Simplified logic and removed redundant methods to enhance maintainability and performance.
Add commands and output verification to test pcp-ps output sorted by %cpu and %mem usage.
- Improved handling of None and empty values, returning '-' instead of None or ambiguous symbols for better readability.
- Adjusted formatting logic for process name and arguments, ensuring consistent column widths.
- Fixed total_mem extraction to handle dict types returned from metrics.
- Updated scheduler policy handling for correctness and clearer fallback ('?').
- Standardized column headers by reducing excessive tab characters for improved alignment.
- Enhanced print_report logic for graceful termination and sorting validation.
These enhancements improve the clarity and robustness of process status reporting in pcp-ps.
Expanded the qa/1987 test to cover pcp-ps output using custom user-selected formats and sorting (e.g., by %mem and %cpu). Updated the expected output file accordingly to verify new behaviors and handle failure cases. This enhances test coverage for pcp-ps formatting and sorting functionality.
Refactored DynamicProcessReporter to consolidate process list formatting and output logic. Improved sorting validation and index determination, especially for the "ALL" filter state.
Add descriptions for the -O (sort by %mem or %cpu) and -d (debug mode)
|
Hi @orasagar , The traditional Am I using the |
|
Hi @kurik , if you like to see the output sorted then you need to have column in the output to be sorted. you can use |
No description provided.