cpu() fix physical cores parsing
This commit is contained in:
parent
c6ff159019
commit
5605b84b77
@ -713,8 +713,10 @@ function getCpu() {
|
|||||||
// const coresPerSocketInt = parseInt(util.getValue(lines, 'cores(s) per socket') || '1', 10);
|
// const coresPerSocketInt = parseInt(util.getValue(lines, 'cores(s) per socket') || '1', 10);
|
||||||
const processors = util.getValue(lines, 'socket(s)') || '1';
|
const processors = util.getValue(lines, 'socket(s)') || '1';
|
||||||
let threadsPerCoreInt = parseInt(threadsPerCore, 10);
|
let threadsPerCoreInt = parseInt(threadsPerCore, 10);
|
||||||
let processorsInt = parseInt(processors, 10);
|
let processorsInt = parseInt(processors, 10) || 1;
|
||||||
result.physicalCores = result.cores / threadsPerCoreInt;
|
const cpus = (parseInt(util.getValue(lines, 'cpu(s)'), 10) || 1);
|
||||||
|
const coresPerSocket = parseInt(util.getValue(lines, 'core(s) per socket'), 10);
|
||||||
|
result.physicalCores = coresPerSocket ? coresPerSocket * processorsInt : result.cores / threadsPerCoreInt;
|
||||||
result.processors = processorsInt;
|
result.processors = processorsInt;
|
||||||
result.governor = util.getValue(lines, 'governor') || '';
|
result.governor = util.getValue(lines, 'governor') || '';
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user