ps_mem icon indicating copy to clipboard operation
ps_mem copied to clipboard

Option for one unit size

Open GioMac opened this issue 6 years ago • 3 comments

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?

GioMac avatar Apr 08 '18 21:04 GioMac

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?

pixelb avatar Apr 17 '18 07:04 pixelb

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.)

neilser avatar Sep 02 '18 18:09 neilser

duplicate of #32

allanlaal avatar Oct 19 '22 01:10 allanlaal