Skip to content

Commit

Permalink
currentLoad() improved parsing (linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhildebrandt committed Nov 9, 2023
1 parent 3a558b2 commit bf5df7f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 7 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.

| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.21.16 | 2023-11-09 | `currentLoad()` improved parsing (linux) |
| 5.21.15 | 2023-10-27 | `wifiConnections()` improved parsing (linux) |
| 5.21.14 | 2023-10-26 | `execSync()` added explicit encoding (linux) |
| 5.21.13 | 2023-10-21 | `system()` Raspberry Pi 5 detection |
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
[![MIT license][license-img]][license-url]

## The Systeminformation Project
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 600 versions published, up to 8 mio downloads per month, > 200 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!
This is amazing. Started as a small project just for myself, it now has > 15,000 lines of code, > 600 versions published, up to 8 mio downloads per month, > 220 mio downloads overall. #1 NPM ranking for backend packages. Thank you to all who contributed to this project!

## Please support this project ... ☕️

Expand All @@ -50,7 +50,7 @@ The new Version 5 is here - this next major version release 5.0 comes with new f
- better uuid function to get unique hardware and OS UUIDs
- better/extended cpu info detection
- better/extended system info detection
- Apple Silicon M1 support
- Apple Silicon M1/M2/M3 support
- better Raspberry-PI detection
- systeminformation website updated and extended with full documentation and examples [systeminformation.io][systeminformation-url]
- lot of minor improvements
Expand Down Expand Up @@ -935,7 +935,7 @@ To be able to measure temperature on macOS I created a little additional package
in NPM with `optionalDependencies` I unfortunately was getting unexpected warnings on other platforms.
So I decided to drop this optional dependency for macOS - so by default, you will not get correct values.

This additional package is now also supporting Apple Silicon M1 machines.
This additional package is now also supporting Apple Silicon M1/M2/M3 machines.

But if you need to detect macOS temperature just run the following additional
installation command:
Expand Down
5 changes: 5 additions & 0 deletions docs/history.html
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,11 @@ <h3>Full version history</h3>
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.21.16</th>
<td>2023-11-09</td>
<td><span class="code">currentLoad()</span> improved parsing (linux)</td>
</tr>
<tr>
<th scope="row">5.21.15</th>
<td>2023-10-27</td>
Expand Down
4 changes: 2 additions & 2 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@
<img class="logo" src="assets/logo.png" alt="logo">
<div class="title">systeminformation</div>
<div class="subtitle"><span id="typed"></span>&nbsp;</div>
<div class="version">New Version: <span id="version">5.21.15</span></div>
<div class="version">New Version: <span id="version">5.21.16</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>
</div>
<div class="down">
Expand Down Expand Up @@ -212,7 +212,7 @@
<div class="title">Downloads last month</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">659</div>
<div class="numbers">663</div>
<div class="title">Dependents</div>
</div>
</div>
Expand Down
2 changes: 1 addition & 1 deletion lib/cpu.js
Original file line number Diff line number Diff line change
Expand Up @@ -1604,7 +1604,7 @@ function getLoad() {
// linux: try to get other cpu stats
if (_linux) {
try {
const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu').toString().split('\n');
const lines = execSync('cat /proc/stat 2>/dev/null | grep cpu', { encoding: 'utf8' }).toString().split('\n');
if (lines.length > 1) {
lines.shift();
if (lines.length === cpus.length) {
Expand Down
2 changes: 1 addition & 1 deletion lib/processes.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,7 @@ function services(srv, callback) {

} else {
ps = lines.filter(function (e) {
return (e.toLowerCase().indexOf(' ' + srv + ':') !== -1) || (e.toLowerCase().indexOf('/' + srv) !== -1);
return (e.toLowerCase().indexOf(' ' + srv.toLowerCase() + ':') !== -1) || (e.toLowerCase().indexOf('/' + srv.toLowerCase()) !== -1);
});
}
const pids = [];
Expand Down

0 comments on commit bf5df7f

Please sign in to comment.