systeminformation icon indicating copy to clipboard operation
systeminformation copied to clipboard

Question: How about more than one CPU instance when using `systeminformation`?

Open liaodalin19903 opened this issue 1 year ago • 3 comments

Is your feature request related to a problem? Please describe.

as we know when using systeminformation to get CPU information like below:

const si = require('systeminformation');

// promises style - new since version 3
si.cpu()
  .then(data => console.log(data))
  .catch(error => console.error(error));

it will get response :

{
  manufacturer: 'Apple',
  brand: 'M1',
  vendor: 'Apple',
  family: '458787763',
  model: '',
  stepping: '2',
  revision: '',
  voltage: '',
  speed: 2.4,
  speedMin: 2.4,
  speedMax: 2.4,
  governor: '',
  cores: 8,
  physicalCores: 8,
  performanceCores: 4,
  efficiencyCores: 4,
  processors: 1,
  socket: 'SOC',
  flags: '',
  virtualization: true,
  cache: { l1d: 131072, l1i: 65536, l2: 4194304, l3: null }
}

but how about 2 CPUs, what will return?

Describe the solution you'd like

I mean if it response a list, it will be more reasonable.

[
{
  manufacturer: 'Apple',
  brand: 'M1',
  vendor: 'Apple',
  family: '458787763',
  model: '',
  stepping: '2',
  revision: '',
  voltage: '',
  speed: 2.4,
  speedMin: 2.4,
  speedMax: 2.4,
  governor: '',
  cores: 8,
  physicalCores: 8,
  performanceCores: 4,
  efficiencyCores: 4,
  processors: 1,
  socket: 'SOC',
  flags: '',
  virtualization: true,
  cache: { l1d: 131072, l1i: 65536, l2: 4194304, l3: null }
}
]

liaodalin19903 avatar Nov 01 '23 04:11 liaodalin19903

@liaodalin19903 thank you for your proposal!

I need to think about that because in 99% of all cases we only would habe 1 CPU and at least we can detect multiple CPUS and this is reported in si.cpu(). I have some more questions:

  • if there are more CPUs - do you have scenarios where there are multiple different CPUs?
  • on MacOS I guess this will never be the case, right?
  • if yes, can you provide the following information (for linux and windows) on one of those machines
# WINDOWS PowerShell
Get-CimInstance Win32_processor | select Name, Revision, L2CacheSize, L3CacheSize, Manufacturer, MaxClockSpeed, Description, UpgradeMethod, Caption, NumberOfLogicalProcessors, NumberOfCores | fl

# LINUX
lscpu; 
echo -n "Governor: "; cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_governor 2>/dev/null;

Thank you in advance!

sebhildebrandt avatar Nov 02 '23 05:11 sebhildebrandt

I am an IT network administrator and I need to know detailed information about multiple CPUs on my computer. How can I solve this situation? Looking forward to your reply

juukee avatar Apr 08 '24 00:04 juukee