Hi there - just wondering if anyone knows of a way to get high-speed measurements of current CPU usage?
My current solution involves calling mpstat and then parsing the result to acquire the CPU utilisation at that moment (this is via Python, btw). This is fine but it only allows a time resolution of one second. This is fine and quite practical but rather unresponsive to short bursts of activity.
I would like to take multiple samples of CPU usage per second (let's say five, but more would be nice). How might I go about this?