@drocketxx/pm2me 1.1.3 → 1.1.4
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.
|
@@ -32,7 +32,7 @@ export const getSystemStats = async () => {
|
|
|
32
32
|
const promises = [];
|
|
33
33
|
|
|
34
34
|
// 1. CPU Usage (Every time)
|
|
35
|
-
const cpuPromise = execPromise('powershell -Command "(Get-Counter \'\\Processor(_Total)\\% Processor Time\' -ErrorAction SilentlyContinue).CounterSamples.CookedValue"')
|
|
35
|
+
const cpuPromise = execPromise('powershell -Command "(Get-Counter \'\\Processor(_Total)\\% Processor Time\' -ErrorAction SilentlyContinue).CounterSamples.CookedValue"', { windowsHide: true })
|
|
36
36
|
.then(({ stdout }) => {
|
|
37
37
|
const realCpu = parseFloat(stdout.trim());
|
|
38
38
|
if (!isNaN(realCpu)) cpuUsage = realCpu;
|
|
@@ -41,7 +41,7 @@ export const getSystemStats = async () => {
|
|
|
41
41
|
promises.push(cpuPromise);
|
|
42
42
|
|
|
43
43
|
// 2. Network Stats (Every time)
|
|
44
|
-
const netPromise = execPromise('powershell -Command "Get-NetAdapterStatistics | Select-Object ReceivedBytes, SentBytes | ConvertTo-Json"')
|
|
44
|
+
const netPromise = execPromise('powershell -Command "Get-NetAdapterStatistics | Select-Object ReceivedBytes, SentBytes | ConvertTo-Json"', { windowsHide: true })
|
|
45
45
|
.then(({ stdout }) => {
|
|
46
46
|
const netData = JSON.parse(stdout);
|
|
47
47
|
let totalRx = 0;
|
|
@@ -67,7 +67,7 @@ export const getSystemStats = async () => {
|
|
|
67
67
|
|
|
68
68
|
// 3. Disk Stats (Cached)
|
|
69
69
|
if (now - cachedDiskStats.lastFetch > DISK_CACHE_TTL) {
|
|
70
|
-
const diskPromise = execPromise('powershell -Command "Get-Volume -DriveLetter C | Select-Object Size, SizeRemaining | ConvertTo-Json"')
|
|
70
|
+
const diskPromise = execPromise('powershell -Command "Get-Volume -DriveLetter C | Select-Object Size, SizeRemaining | ConvertTo-Json"', { windowsHide: true })
|
|
71
71
|
.then(({ stdout }) => {
|
|
72
72
|
const data = JSON.parse(stdout);
|
|
73
73
|
if (data.Size > 0) {
|