Often I feel the need to run some computation on the data about my system load. For instance about the data that
top shows. And possibly
htop as well.
Some of the things I'd like to do are the following:
Compute average, max and min CPU load (divided in user time, system, idle etc, like top shows it) for each core (or for the average core) over 10 seconds.
Computer average, max and min CPU time for each process over 10 seconds. And then compute the average, max and min for each process sharing the same process name or Group ID.
Compute the total amount of resident RAM used by all the chromium or firefox processes, without counting shared memory regions twice.
Compute the average network usage and max bandwidth per process and per interface over a few minutes.
I know that
ps are fetching their data from
/proc, but understanding the semantics for those files and parsing them is harder than I wish: it takes a proper script/program. I'd love to be able to play with this data writing a for loop in my bash.
Is there any abstraction to the system load data which is simple and quick to use?