| 4.19.1 |
2020-01-14 |
diff --git a/docs/index.html b/docs/index.html
index f414e98..1b34972 100644
--- a/docs/index.html
+++ b/docs/index.html
@@ -168,7 +168,7 @@
systeminformation
- Current Version: 4.19.1
+ Current Version: 4.19.2
diff --git a/lib/cpu.js b/lib/cpu.js
index f396a95..f40d879 100644
--- a/lib/cpu.js
+++ b/lib/cpu.js
@@ -625,7 +625,7 @@ function getCpu() {
result.socket = socketTypes[socketId];
}
// # threads / # cores
- const countProcessors = util.countUniqueLines(lines, 'Caption');
+ const countProcessors = util.countLines(lines, 'Caption');
const countThreads = util.getValue(lines, 'NumberOfLogicalProcessors', '=');
const countCores = util.getValue(lines, 'NumberOfCores', '=');
if (countProcessors) {
@@ -635,6 +635,10 @@ function getCpu() {
result.cores = parseInt(countThreads) || 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) => {
if (!error) {
diff --git a/lib/util.js b/lib/util.js
index 17414c2..015764b 100644
--- a/lib/util.js
+++ b/lib/util.js
@@ -450,7 +450,7 @@ function countUniqueLines(lines, startingWith) {
startingWith = startingWith || '';
const uniqueLines = [];
lines.forEach(line => {
- if (line.indexOf(startingWith) === 0) {
+ if (line.startsWith(startingWith)) {
if (uniqueLines.indexOf(line) === -1) {
uniqueLines.push(line);
}
@@ -459,6 +459,17 @@ function countUniqueLines(lines, startingWith) {
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() { }
exports.toInt = toInt;
@@ -481,6 +492,7 @@ exports.getVboxmanage = getVboxmanage;
exports.powerShell = powerShell;
exports.nanoSeconds = nanoSeconds;
exports.countUniqueLines = countUniqueLines;
+exports.countLines = countLines;
exports.noop = noop;
exports.isRaspberry = isRaspberry;
exports.isRaspbian = isRaspbian;