bugfix cpuTemperature() - max value on windows
This commit is contained in:
parent
098aba023c
commit
e677113bdf
@ -98,6 +98,7 @@ Other changes
|
|||||||
|
|
||||||
| Version | Date | Comment |
|
| Version | Date | Comment |
|
||||||
| -------------- | -------------- | -------- |
|
| -------------- | -------------- | -------- |
|
||||||
|
| 3.30.3 | 2017-10-03 | bugfix `cpuTemperature()` - max value on windows |
|
||||||
| 3.30.2 | 2017-09-26 | bugfix `networkInterfaces()` - optimized ip6 address selection |
|
| 3.30.2 | 2017-09-26 | bugfix `networkInterfaces()` - optimized ip6 address selection |
|
||||||
| 3.30.1 | 2017-09-21 | bugfix/typo `inetChecksite()` |
|
| 3.30.1 | 2017-09-21 | bugfix/typo `inetChecksite()` |
|
||||||
| 3.30.0 | 2017-09-21 | extended `versions()` (added `yarn`, `gulp`, `grunt`, `tsc`, `git`) |
|
| 3.30.0 | 2017-09-21 | extended `versions()` (added `yarn`, `gulp`, `grunt`, `tsc`, `git`) |
|
||||||
|
|||||||
@ -158,7 +158,7 @@ I also created a nice little command line tool called [mmon][mmon-github-url] (
|
|||||||
| | min | X | X | X | min CPU speed (all cores) |
|
| | min | X | X | X | min CPU speed (all cores) |
|
||||||
| | max | X | X | X | max CPU speed (all cores) |
|
| | max | X | X | X | max CPU speed (all cores) |
|
||||||
| si.cpuTemperature(cb) | {...} | X | X* | X | CPU temperature (if supported) |
|
| si.cpuTemperature(cb) | {...} | X | X* | X | CPU temperature (if supported) |
|
||||||
| | main | X | X | X | main temperature |
|
| | main | X | X | X | main temperature (avg) |
|
||||||
| | cores | X | X | X | array of temperatures |
|
| | cores | X | X | X | array of temperatures |
|
||||||
| | max | X | X | X | max temperature |
|
| | max | X | X | X | max temperature |
|
||||||
| si.mem(cb) | {...} | X | X | X | Memory information (in bytes)|
|
| si.mem(cb) | {...} | X | X | X | Memory information (in bytes)|
|
||||||
|
|||||||
@ -366,11 +366,13 @@ function cpuTemperature(callback) {
|
|||||||
let sum = 0;
|
let sum = 0;
|
||||||
let lines = stdout.trim().split(/\s\s+/);
|
let lines = stdout.trim().split(/\s\s+/);
|
||||||
lines.forEach(function (line) {
|
lines.forEach(function (line) {
|
||||||
if (line.match('CriticalTripPoint') && !result.max)
|
// if (line.match('CriticalTripPoint') && result.max === -1)
|
||||||
result.max = (parseInt(line.split('CriticalTripPoint=')[1]) - 2732) / 10;
|
// result.max = (parseInt(line.split('CriticalTripPoint=')[1]) - 2732) / 10;
|
||||||
else if (line.match('CurrentTemperature')) {
|
// else
|
||||||
|
if (line.match('CurrentTemperature')) {
|
||||||
let value = (parseInt(line.split('CurrentTemperature=')[1]) - 2732) / 10;
|
let value = (parseInt(line.split('CurrentTemperature=')[1]) - 2732) / 10;
|
||||||
sum = sum + value;
|
sum = sum + value;
|
||||||
|
if (value > result.max) result.max = value;
|
||||||
result.cores.push(value);
|
result.cores.push(value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user