cpu() muli-processor fix windows
This commit is contained in:
parent
544b60f1b0
commit
8e9e4042b2
@ -30,6 +30,7 @@ For major (breaking) changes - version 3 and 2 see end of page.
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 4.19.2 | 2020-01-19 | `cpu()` muli-processor fix windows |
|
||||||
| 4.19.1 | 2020-01-14 | `osInfo()` uefi fix windows |
|
| 4.19.1 | 2020-01-14 | `osInfo()` uefi fix windows |
|
||||||
| 4.19.0 | 2020-01-12 | `osInfo()` added uefi |
|
| 4.19.0 | 2020-01-12 | `osInfo()` added uefi |
|
||||||
| 4.18.3 | 2020-01-10 | `fsSize()` fix excluding loop/snap devices |
|
| 4.18.3 | 2020-01-10 | `fsSize()` fix excluding loop/snap devices |
|
||||||
|
|||||||
@ -83,6 +83,11 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<th scope="row">4.19.2</th>
|
||||||
|
<td>2020-01-19</td>
|
||||||
|
<td><span class="code">cpu()</span> multi-processor fix windows</td>
|
||||||
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">4.19.1</th>
|
<th scope="row">4.19.1</th>
|
||||||
<td>2020-01-14</td>
|
<td>2020-01-14</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.19.1</span></div>
|
<div class="version">Current Version: <span id="version">4.19.2</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">
|
||||||
|
|||||||
@ -625,7 +625,7 @@ function getCpu() {
|
|||||||
result.socket = socketTypes[socketId];
|
result.socket = socketTypes[socketId];
|
||||||
}
|
}
|
||||||
// # threads / # cores
|
// # threads / # cores
|
||||||
const countProcessors = util.countUniqueLines(lines, 'Caption');
|
const countProcessors = util.countLines(lines, 'Caption');
|
||||||
const countThreads = util.getValue(lines, 'NumberOfLogicalProcessors', '=');
|
const countThreads = util.getValue(lines, 'NumberOfLogicalProcessors', '=');
|
||||||
const countCores = util.getValue(lines, 'NumberOfCores', '=');
|
const countCores = util.getValue(lines, 'NumberOfCores', '=');
|
||||||
if (countProcessors) {
|
if (countProcessors) {
|
||||||
@ -635,6 +635,10 @@ function getCpu() {
|
|||||||
result.cores = parseInt(countThreads) || util.cores();
|
result.cores = parseInt(countThreads) || util.cores();
|
||||||
result.physicalCores = parseInt(countCores) || util.cores();
|
result.physicalCores = parseInt(countCores) || util.cores();
|
||||||
}
|
}
|
||||||
|
if (countProcessors > 1) {
|
||||||
|
result.cores = result.cores * countProcessors;
|
||||||
|
result.physicalCores = result.physicalCores * countProcessors;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
util.wmic('path Win32_CacheMemory get CacheType,InstalledSize,Purpose').then((stdout, error) => {
|
util.wmic('path Win32_CacheMemory get CacheType,InstalledSize,Purpose').then((stdout, error) => {
|
||||||
if (!error) {
|
if (!error) {
|
||||||
|
|||||||
14
lib/util.js
14
lib/util.js
@ -450,7 +450,7 @@ function countUniqueLines(lines, startingWith) {
|
|||||||
startingWith = startingWith || '';
|
startingWith = startingWith || '';
|
||||||
const uniqueLines = [];
|
const uniqueLines = [];
|
||||||
lines.forEach(line => {
|
lines.forEach(line => {
|
||||||
if (line.indexOf(startingWith) === 0) {
|
if (line.startsWith(startingWith)) {
|
||||||
if (uniqueLines.indexOf(line) === -1) {
|
if (uniqueLines.indexOf(line) === -1) {
|
||||||
uniqueLines.push(line);
|
uniqueLines.push(line);
|
||||||
}
|
}
|
||||||
@ -459,6 +459,17 @@ function countUniqueLines(lines, startingWith) {
|
|||||||
return uniqueLines.length;
|
return uniqueLines.length;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function countLines(lines, startingWith) {
|
||||||
|
startingWith = startingWith || '';
|
||||||
|
const uniqueLines = [];
|
||||||
|
lines.forEach(line => {
|
||||||
|
if (line.startsWith(startingWith)) {
|
||||||
|
uniqueLines.push(line);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
return uniqueLines.length;
|
||||||
|
}
|
||||||
|
|
||||||
function noop() { }
|
function noop() { }
|
||||||
|
|
||||||
exports.toInt = toInt;
|
exports.toInt = toInt;
|
||||||
@ -481,6 +492,7 @@ exports.getVboxmanage = getVboxmanage;
|
|||||||
exports.powerShell = powerShell;
|
exports.powerShell = powerShell;
|
||||||
exports.nanoSeconds = nanoSeconds;
|
exports.nanoSeconds = nanoSeconds;
|
||||||
exports.countUniqueLines = countUniqueLines;
|
exports.countUniqueLines = countUniqueLines;
|
||||||
|
exports.countLines = countLines;
|
||||||
exports.noop = noop;
|
exports.noop = noop;
|
||||||
exports.isRaspberry = isRaspberry;
|
exports.isRaspberry = isRaspberry;
|
||||||
exports.isRaspbian = isRaspbian;
|
exports.isRaspbian = isRaspbian;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user