Posts: 41
Joined: Mon Feb 04, 2013 11:05 am

Rapid reading of CPU utilisation

Thu Feb 14, 2013 12:40 pm

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?

Return to “Raspbian”