This question has already been answered:

There is an opinion that one of the installed and running programs is eaten by the CPU.

Can I somehow see the statistics on this program, for example in the last hour?

In my top and htop, as I understand it, only real-time statistics are shown, and this does not suit me.

Reported as a duplicate by members of aleksandr barakin , cheops , zRrr , user194374, fori1ton July 5, '16 at 6:39 .

A similar question was asked earlier and an answer has already been received. If the answers provided are not exhaustive, please ask a new question .

  • Atop turns in the background and collects statistics. You can also collect your script data from / proc how much CPU time the program ate and then calculate how much is from the total utilization of cpu - zersh

1 answer 1

For example, every second you can run the ps command for a specific pid with output to the stats.txt file. You can different variations and mess with the output format, recording for example the current time or other parameters. Then you can build a graph in some gnumeric

watch -n 1 'ps -p <pid> -o %cpu | tail -1 >> stats.txt'