![]() Moderator ![]()
|
I use some KSysguard classes to get a list of processes and get some information about them. But now I want to get the percentage of their CPU using (e.g. the processes "dolphin" consumes 10% of the CPU load). I didn't find something which helps me. Only two things:
Could this be the thing I search for? Or do you have any other clues for me? If someone wants to have a look at the code where this should get in, he/she can find it in playground: playground/base/plasma/runners/kill Thanks in advance. ![]() |
![]() Administrator ![]()
|
From the Model KSysGuard uses:
Therefore the answer is process->userUsage + process->sysUsage = Total CPU Usage. If you wish to include their children in their usage as well, you would use process->totalUserUsage + process->totalSysUsage instead. You may wish to "normalize" it also, by dividing usage by the number of cores.
KDE Sysadmin
[img]content/bcooksley_sig.png[/img] |
![]() Moderator ![]()
|
Thanks for the help, bcooksley. That's what I wanted.
![]() |
Registered users: Bing [Bot], daret, Google [Bot], sandyvee, Sogou [Bot]