Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to capture the CPU core usage from system monitor program?

I have a python program running using a parallel python. This module scales my job submitted to individual cores of my computer , I don't know how does it do it but when i check my system monitor it clearly shows 100% usage in both the cores (I am running some really heavy jobs).

Is there any python module or tool which allows me to capture the individual core usage from the system monitor program when I run my job?

like image 604
Rahul Avatar asked Jul 22 '11 08:07

Rahul


People also ask

How do I check my CPU usage with Performance Monitor?

Using Task Manager to Check CPU Usage In the following window, click Task Manager. While in Task Manager, click the Performance tab. Here in the Performance tab, you can see how much of the CPU the computer is currently using. If you want to see which apps are using the CPU the most, head back to the Processes tab.

How do I monitor my CPU cores?

Right-click the taskbar and select Task Manager from the context menu. Go to the Performance tab and select CPU. Right-click on the graph in the right pane and select Change graph to>Logical processors. You will see a graph for each core and its usage.


1 Answers

psutil:

>>> for x in range(3):
...     psutil.cpu_percent(interval=1, percpu=True)
... 
[4.0, 6.9]
[7.0, 8.5]
[1.2, 9.0]
like image 117
Eryk Sun Avatar answered Sep 18 '22 00:09

Eryk Sun