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

Option for one unit size #39

Open
GioMac opened this issue Apr 8, 2018 · 3 comments
Open

Option for one unit size #39

GioMac opened this issue Apr 8, 2018 · 3 comments

Comments

@GioMac
Copy link

GioMac commented Apr 8, 2018

It's very hard to parse the output, because we need to differentiate KiB and GiB, convert them to use in automation, monitoring tools etc.
Can we please have an option to use only MiB's or B's?

@pixelb
Copy link
Owner

pixelb commented Apr 17, 2018

Note the --total option outputs a single number unformatted, and is meant for automated tools.
Is it practical to do other automated processing on the output?

@neilser
Copy link

neilser commented Sep 2, 2018

I'm interested in this option as well.
I have a few hundred php-fpm processes for which I want to check memory usage vs. the number of requests served. ps_mem does a lovely job of getting the memory usage, and although I can readily extract the memory info per process with "ps_mem -d" and then a bit of grep/awk etc., the output will be mangled if any of the processes ever cross a human boundary (e.g. kiB instead of MiB).
I can hack my own version to do it this way of course, but having it in the master version seems more attractive :-D
I'm happy to propose a patch if that helps.
(Btw: seriously useful bit of code, this! I haven't found a built-in utility which does the same thing, which is baffling after all these years.)

@allanlaal
Copy link

duplicate of #32

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

4 participants