systeminformation 5.10.4 → 5.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/lib/processes.js +6 -6
  2. package/package.json +1 -1
package/lib/processes.js CHANGED
@@ -324,13 +324,13 @@ function services(srv, callback) {
324
324
  }
325
325
  if (_windows) {
326
326
  try {
327
- let wincommand = "Get-WmiObject Win32_Service";
327
+ let wincommand = 'Get-WmiObject Win32_Service';
328
328
  if (srvs[0] !== '*') {
329
329
  wincommand += ' -Filter "';
330
330
  for (let i = 0; i < srvs.length; i++) {
331
331
  wincommand += `Name='${srvs[i]}' or `;
332
332
  }
333
- wincommand = `${wincommand.slice(0,-4)}"`;
333
+ wincommand = `${wincommand.slice(0, -4)}"`;
334
334
  }
335
335
  wincommand += ' | fl *';
336
336
  util.powerShell(wincommand).then((stdout, error) => {
@@ -817,8 +817,8 @@ function processes(callback) {
817
817
  let utime = parseInt(util.getValue(lines, 'UserModeTime', ':', true), 10);
818
818
  let stime = parseInt(util.getValue(lines, 'KernelModeTime', ':', true), 10);
819
819
  let memw = parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10);
820
- allcpuu = allcpuu + utime;
821
- allcpus = allcpus + stime;
820
+ allcpuu += utime - (_processes_cpu.list[pid] ? _processes_cpu.list[pid].utime : 0);
821
+ allcpus += stime - (_processes_cpu.list[pid] ? _processes_cpu.list[pid].stime : 0);
822
822
  result.all++;
823
823
  if (!statusValue) { result.unknown++; }
824
824
  if (statusValue === '3') { result.running++; }
@@ -982,8 +982,8 @@ function processLoad(proc, callback) {
982
982
  let utime = parseInt(util.getValue(lines, 'UserModeTime', ':', true), 10);
983
983
  let stime = parseInt(util.getValue(lines, 'KernelModeTime', ':', true), 10);
984
984
  let mem = parseInt(util.getValue(lines, 'WorkingSetSize', ':', true), 10);
985
- allcpuu = allcpuu + utime;
986
- allcpus = allcpus + stime;
985
+ allcpuu += utime - (_process_cpu.list[pid] ? _process_cpu.list[pid].utime : 0);
986
+ allcpus += stime - (_process_cpu.list[pid] ? _process_cpu.list[pid].stime : 0);
987
987
 
988
988
  procStats.push({
989
989
  pid: pid,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "systeminformation",
3
- "version": "5.10.4",
3
+ "version": "5.10.5",
4
4
  "description": "Advanced, lightweight system and OS information library",
5
5
  "license": "MIT",
6
6
  "author": "Sebastian Hildebrandt <hildebrandt@plus-innovations.com> (https://plus-innovations.com)",