I want to output the following:
Average CPU utilization across all cores, over the last n seconds, in a single percentage value.
So if I have 4 CPUs and their combined user and system utilization over the last 10 seconds is:
# not actual output
CPU1 10%
CPU2 20%
CPU3 30%
CPU4 40%
I want to be able to get this output:
25
Since the average of those utilizations is 25%.
What is the simplest one-liner to output this value?
(Not being able to specify the duration is fine, as long as it's a reasonable default).