David Luo
David Luo
@Hachiverol `top` isn't exactly supposed to be machine readable. There's better APIs for that. Currently planning on moving to `psutil` for better compatibility. See #20.
@Hachiverol [`glances` depends on `psutil`.](https://github.com/nicolargo/glances/blob/develop/requirements.txt) In any case, it's pretty heavyweight for what we're trying to do.
@anirudhajith The last time I looked into this, I remember reading that `psutil`'s `cpu_percent` (and maybe `memory_percent` as well; I don't recall) only gives back a non-zero percentage after the...
Well that would be the most straightforward thing to do.
This could be fixed by using [psutil](https://github.com/giampaolo/psutil) instead of the output of `top(1)`. Would also make it easier to manipulate the data. #20
Actually I'm gonna change a few things about how the arguments are handled. I'll reopen this once that is done.
On second thought, I'm going to make a separate issue for what i was thinking.
@anirudhajith What do you mean? Can you provide an example?
@anirudhajith alright, I'm gonna pull the branch and make some changes.
@anirudhajith according to [psutil's docs](https://psutil.readthedocs.io/en/latest/#psutil.Process.cpu_percent), the first time that `cpu_percent` is retrieved, it will always return 0% CPU usage. As such **all** processes from when you iterate through `psutil.process_iter` will...