getCpu() fix physicalCores (linux)
This commit is contained in:
parent
6821fc4374
commit
1e2522a095
@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 4.14.12 | 2019-10-14 | getCpu() fixed multi socket detection (linux) |
|
||||||
| 4.14.11 | 2019-10-01 | type definitions fix dockerInfo |
|
| 4.14.11 | 2019-10-01 | type definitions fix dockerInfo |
|
||||||
| 4.14.10 | 2019-10-01 | type definitions fix memLayout |
|
| 4.14.10 | 2019-10-01 | type definitions fix memLayout |
|
||||||
| 4.14.9 | 2019-10-01 | `processLoad()` fix windows |
|
| 4.14.9 | 2019-10-01 | `processLoad()` fix windows |
|
||||||
|
|||||||
@ -29,7 +29,7 @@
|
|||||||
[![Caretaker][caretaker-image]][caretaker-url]
|
[![Caretaker][caretaker-image]][caretaker-url]
|
||||||
[![MIT license][license-img]][license-url]
|
[![MIT license][license-img]][license-url]
|
||||||
|
|
||||||
**2019-03-12** - 5th birthday of systeminformation. This is amazing. Started as a small projekt just for myself, it now has > 8,000 lines of code, > 200 versions published, up to 100,000 downloads per month, > 1 Mio downloads overall. Thank you to all who contributed to this project!
|
This is amazing. Started as a small projekt just for myself, it now has > 9,000 lines of code, > 200 versions published, up to 150,000 downloads per month, > 1 Mio downloads overall. Thank you to all who contributed to this project!
|
||||||
|
|
||||||
## New Version 4.0
|
## New Version 4.0
|
||||||
|
|
||||||
|
|||||||
@ -83,6 +83,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">4.14.12</th>
|
||||||
|
<td>2019-10-14</td>
|
||||||
|
<td><span class="code">getCpu()</span> fixed multi socket detection (linux)</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">4.14.11</th>
|
<th scope="row">4.14.11</th>
|
||||||
<td>2019-10-01</td>
|
<td>2019-10-01</td>
|
||||||
|
|||||||
@ -168,7 +168,7 @@
|
|||||||
<img class="logo" src="assets/logo.png">
|
<img class="logo" src="assets/logo.png">
|
||||||
<div class="title">systeminformation</div>
|
<div class="title">systeminformation</div>
|
||||||
<div class="subtitle"><span id="typed"></span></div>
|
<div class="subtitle"><span id="typed"></span></div>
|
||||||
<div class="version">Current Version: <span id="version">4.14.11</span></div>
|
<div class="version">Current Version: <span id="version">4.14.12</span></div>
|
||||||
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
<button class="btn btn-light" onclick="location.href='https://github.com/sebhildebrandt/systeminformation'">View on Github <i class=" fab fa-github"></i></button>
|
||||||
</div>
|
</div>
|
||||||
<div class="down">
|
<div class="down">
|
||||||
@ -199,7 +199,7 @@
|
|||||||
<div class="title">Downloads last month</div>
|
<div class="title">Downloads last month</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
|
||||||
<div class="numbers">192</div>
|
<div class="numbers">200</div>
|
||||||
<div class="title">Dependends</div>
|
<div class="title">Dependends</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
25
lib/cpu.js
25
lib/cpu.js
@ -336,31 +336,6 @@ function getCpu() {
|
|||||||
result.socket = util.getValue(lines2, 'Upgrade').replace('Socket', '').trim();
|
result.socket = util.getValue(lines2, 'Upgrade').replace('Socket', '').trim();
|
||||||
}
|
}
|
||||||
resolve(result);
|
resolve(result);
|
||||||
|
|
||||||
// // # processurs & # threads/core - method 1
|
|
||||||
// let threadsPerCoreInt = 0;
|
|
||||||
// let lines3 = [];
|
|
||||||
// exec('cat /proc/cpuinfo | grep -E "physical id|core id"', function (error2, stdout3) {
|
|
||||||
// lines3 = stdout3.toString().split('\n');
|
|
||||||
// if (lines3 && lines3.length) {
|
|
||||||
// result.processors = util.countUniqueLines(lines3, 'physical id') || 1;
|
|
||||||
// result.physicalCores = util.countLinesStartingWith(lines3, 'core id') / result.processors;
|
|
||||||
// if (result.physicalCores) {
|
|
||||||
// threadsPerCoreInt = result.cores / result.physicalCores;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// // # threads/core - method 2
|
|
||||||
// if (threadsPerCoreInt === 0) {
|
|
||||||
// const threadsPerCore = util.getValue(lines, 'thread(s) per core');
|
|
||||||
// if (threadsPerCore) {
|
|
||||||
// threadsPerCoreInt = parseInt(threadsPerCore, 10);
|
|
||||||
// if (!isNaN(threadsPerCoreInt)) {
|
|
||||||
// result.physicalCores = result.cores / threadsPerCoreInt;
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// resolve(result);
|
|
||||||
// });
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|||||||
@ -455,11 +455,6 @@ function countUniqueLines(lines, startingWith) {
|
|||||||
return uniqueLines.length;
|
return uniqueLines.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
// function countLinesStartingWith(lines, startingWith) {
|
|
||||||
// startingWith = startingWith || '';
|
|
||||||
// return lines.filter(el => el.startsWith(startingWith)).length;
|
|
||||||
// }
|
|
||||||
|
|
||||||
function noop() { }
|
function noop() { }
|
||||||
|
|
||||||
exports.toInt = toInt;
|
exports.toInt = toInt;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user