-
-
Notifications
You must be signed in to change notification settings - Fork 255
pcp-top: inital imlemenation of pcp-top utility #2409
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
Revise pcp-top.1 to replace slabinfo references with accurate top-like monitor details, update description to reflect real-time process/system metrics, and document new command-line options for improved usability and clarity.
…p.py memory formatting - Added pcp-top archive files and mk.top script for reproducibility and QA. - Refactored pcp-top.py to use GIGABYTE constant for memory formatting. - Improved load average handling in pcp-top.py for robustness with fallback values.
Refactored TopUtil to cache process metrics for improved efficiency and reduced repeated lookups. Introduced unified metric fetching helper and updated memory usage calculation method to leverage cached values. Removed unused import and cleaned up method definitions for clarity.
- Clarify 'START' field as user+system time (MM:SS) in man page - Correct default process count from 2000 to 100 in CLI docs - Enhance process_data_list with documentation on returned structure and sorting logic
Introduce test script 1904 to automate verification of pcp-top output under various sorting and filter options.
Replace lambda functions with direct method calls for vsize and rss conversion to gigabytes in process listing.
Refactored per-process field descriptions in the pcp-top manpage.
This reverts commit 37a7567.
|
@orasagar We already have |
|
Yeah, agreeing with @kurik here - not sure there's a need for a third top-like tool in PCP. It'd be best to improve the existing ones if features are missing - pcp-htop in particular is under active development and even supports arbitrary metrics (i.e. beyond top processes). Is there something novel in this new approach I'm missing here @orasagar ? Thanks! |
|
Hi @kurik and @natoscott , Additionally, both tools output data in a slightly different format compared to other PCP tools currently in use. This inconsistency makes parsing more difficult. with this tool we are trying to achieve is give user flexibility to sort top %cpu or %mem consumer. |
|
@orasagar this new pcp-top uses the same PMAPI interfaces so has exactly the same performance issues, no? Do you have some perf profiles you can share showing the problem and how pcp-top resolves it? FWIW, pcp-htop does not yet support archive mode (this would be wonderful to add though). pcp-atop can be slow on some archives, but there have been numerous improvements recently, particularly when using zstd compression - have you tried this? IMO the answer to improved performance is not to add a new tool, but to analyse and improve the existing tools. Re sorting output, it makes little sense to me to post-process top tool output - why not use something like pmrep or the top-most options to pcp-atopsar? However, if you must do sorting, then implement a new output mode for an existing tool, no need to add an entire new one. The upstream atop code has a JSON output option, perhaps we should back-port that to pcp-atop? Finally, there was a pcp-xsos tool added last year to provide another, single-sample rapid overview from an archive - might help those users with performance concerns as well. |
|
@natoscott I don’t have performance profiles to share at the moment, but I’d like to clarify the motivation behind this tool. The main goal is to bring consistency with other PCP tools output and align more closely with the standard top batch mode output. While similar functionality can be achieved with pmrep, it requires user to know specific metrics, which isn’t always straightforward. Looking ahead, I plan to evolve this tool to use hotproc metrics, making it more dynamic and flexible as those metrics are captured. I agree that backporting the JSON output option is a good idea, but it will take some time. Also, atop already has a very large set of options, which can be overwhelming for users. The intent here is to provide a simpler, more consistent interface that addresses common use cases without adding to that complexity. |
|
Hi @orasagar,
Have a look below /etc/pcp/pmrep - these files configure sets of metrics that can be requested on the pmrep command line, as a group, to address this kind of problem.
pcp-atop(1) already has a mode where it can use hotproc metrics FWIW - see the --hotproc option. |
|
Hi @natoscott , |
|
@orasagar sounds like a good idea to me! |
No description provided.