-
-
Notifications
You must be signed in to change notification settings - Fork 314
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -702,7 +702,7 @@ function getCpu() { | |
if (os.arch() === 'arm64') { | ||
result.socket = 'SOC'; | ||
try { | ||
const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type', { encoding: 'utf8' }).toString().split('\n'); | ||
const clusters = execSync('ioreg -c IOPlatformDevice -d 3 -r | grep cluster-type').toString().split('\n'); | ||
const efficiencyCores = clusters.filter(line => line.indexOf('"E"') >= 0).length; | ||
const performanceCores = clusters.filter(line => line.indexOf('"P"') >= 0).length; | ||
result.efficiencyCores = efficiencyCores; | ||
|
@@ -1048,7 +1048,7 @@ function cpuTemperature(callback) { | |
// CPU Chipset, Socket | ||
try { | ||
const cmd = 'cat /sys/class/thermal/thermal_zone*/type 2>/dev/null; echo "-----"; cat /sys/class/thermal/thermal_zone*/temp 2>/dev/null;'; | ||
const parts = execSync(cmd, { encoding: 'utf8' }).toString().split('-----\n'); | ||
const parts = execSync(cmd).toString().split('-----\n'); | ||
if (parts.length === 2) { | ||
const lines = parts[0].split('\n'); | ||
const lines2 = parts[1].split('\n'); | ||
|
@@ -1604,7 +1604,7 @@ function getLoad() { | |
// linux: try to get other cpu stats | ||
if (_linux) { | ||
try { | ||
const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu', { encoding: 'utf8' }).split('\n'); | ||
const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu').toString().split('\n'); | ||
This comment has been minimized.
Sorry, something went wrong.
This comment has been minimized.
Sorry, something went wrong.
sebhildebrandt
Author
Owner
|
||
if (lines.length > 1) { | ||
lines.shift(); | ||
if (lines.length === cpus.length) { | ||
|
I have a question?
What is the reason for removing utf 8? for this line it causes phantom logs to be printed.