Skip to content
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

ADD option to only include RAM used column (omits Private and Shared) #76

Open
allanlaal opened this issue Oct 19, 2022 · 4 comments
Open

Comments

@allanlaal
Copy link

Add a separate command line flag, so the output columns would only be RAM used and Program (and whatever new ones are added)

use case:

I only care about total RAM used per app

@pixelb
Copy link
Owner

pixelb commented Oct 21, 2022

You could take advantage of the alignment to do ps_mem | cut -b25-.
I suppose we could add an option to select columns (which would generalize -S that shows the swap column).
Re alignment we wouldn't be able to rely on alignment if we let users choose a unit (which is probably a good idea (as per issue #39))

@allanlaal
Copy link
Author

@pixelb custom columns would still result in a known and repeatable alignment for those columns, no?

@pixelb
Copy link
Owner

pixelb commented Nov 9, 2022

Right. Alignment issues would only be for configurable units. Columns would not impact that

@zen2
Copy link

zen2 commented Jul 19, 2024

The best way to support custom display is to propose several options as classical linux commands:

-h -> for human display (scale value to shortest three digit unit and display unit - actual ps_mem default)
--units=UNITS -> to force unit usage (without print unit)
-o (--output) -> option that takes a comma-separated list of output fields as private, shared, used, process
--no-headers or --headers -> display columns header line or not
--separator=SEPARATOR -> to choose separator

Actually ps_mem used -h and --headers by default.
-o/--no-headers/--separator permit to create csv output that can be easily parsed by other commands or programs.

Alignment is not an issue if columns size are calculated dynamically as the unix command "column -t" does.

Note: I actually parsed ps_mem output by my own monitoring nrpe script to graph main process usage on servers.
Adding these options could bring ps_mem to a classical unix command for years !

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

No branches or pull requests

3 participants