processLoad() fix windows

This commit is contained in:
Sebastian Hildebrandt
2019-10-01 16:41:26 +02:00
parent e75fa71566
commit a081fe618b
4 changed files with 12 additions and 4 deletions
+5 -3
View File
@@ -867,9 +867,11 @@ function processLoad(proc, callback) {
let resultProcess = calcProcStatWin(procStats[i], allcpuu + allcpus, _process_cpu);
// store pcpu in outer array
let listPos = result.pids.indexOf(resultProcess.pid);
if (listPos >= 0) {
result.cpu = resultProcess.pcpuu + resultProcess.pcpus;
if (result && result.pids && result.pids.length > 0) {
let listPos = result.pids.indexOf(resultProcess.pid);
if (listPos >= 0) {
result.cpu = resultProcess.pcpuu + resultProcess.pcpus;
}
}
// save new values