Closed drug007 closed 3 years ago
Makes sense. I'll add a separate method later.
Added a currentTotal
method for ProcessCPUWatcher. Do you think it's a good name?
Good naming is hard) I would suggest usagePerCore
/totalUsage
. But your variant is good.
Currently
resusage
divides CPU usage by CPU count i.e. returns average CPU usage for the whole system. This is true if the process really uses all cores and wrong if the application is, for example, single-threaded. Wouldn't it be more correct to return just total usage? Because concerning CPU count we need to determine what amount of cores the application is using that is not trivial in general. For example,top
return just total usage.