currentLoad() added steal and guest time (linux)

This commit is contained in:
Sebastian Hildebrandt 2023-08-22 16:23:12 +02:00
parent e3dc1bfec5
commit 0701635c28
7 changed files with 53 additions and 7 deletions

View File

@ -48,6 +48,7 @@ We had to make **several interface changes** to keep systeminformation as consis
- `cpu()`: added virtualization if cpu supports virtualization
- `cpu()`: now flags are part of this function
- `cpuTemperature()` added socket and chipset temp (linux)
- `currentLoad()` added steal and guest time (linux)
- `disksIO()` added wait time (linux)
- `diskLayout()`: added USB drives (mac OS)
- `diskLayout()`: added S.M.R.R.T. (win)
@ -82,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.19.0 | 2023-08-22 | `currentLoad()` added steal and guest time (linux) |
| 5.18.15 | 2023-08-10 | `npm` command extended |
| 5.18.14 | 2023-08-09 | `fsSIze()` fixed syntax error |
| 5.18.13 | 2023-08-08 | `mem()` fixed error handling |

View File

@ -128,6 +128,7 @@ si.cpu()
(last 7 major and minor version releases)
- Version 5.19.0: `currentLoad()` added steal and guest time (linux)
- Version 5.18.0: `fsSize()` added optional drive parameter
- Version 5.17.0: `graphics()` added positionX, positionY (mac OS)
- Version 5.16.0: `fsSize()` added rw property

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
<th scope="row">5.19.0</th>
<td>2023-08-22</td>
<td><span class="code">currentLoad()</span> new properties steal and guest time (linux)</td>
</tr>
<tr>
<th scope="row">5.18.15</th>
<td>2023-08-10</td>

View File

@ -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.18.15</span></div>
<div class="version">New Version: <span id="version">5.19.0</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">
@ -204,7 +204,7 @@
</div>
<div class="row number-section">
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
<div class="numbers">15,577</div>
<div class="numbers">15,642</div>
<div class="title">Lines of code</div>
</div>
<div class="col-xl-4 col-lg-4 col-md-4 col-12">
@ -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">637</div>
<div class="numbers">642</div>
<div class="title">Dependents</div>
</div>
</div>

View File

@ -145,7 +145,27 @@
<td>X</td>
<td>X</td>
<td>X</td>
<td>CPU load system in %</td>
<td>CPU load hardware interrupts in %</td>
</tr>
<tr>
<td></td>
<td>currentLoadSteal</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td>Time stolen by other OS running in VMs in %</td>
</tr>
<tr>
<td></td>
<td>currentLoadGuest</td>
<td>X</td>
<td></td>
<td>X</td>
<td>X</td>
<td>X</td>
<td>Time spent for running virtual CPU in %</td>
</tr>
<tr>
<td></td>
@ -188,6 +208,8 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
rawCurrentLoadNice: 0,
rawCurrentLoadIdle: 7740,
rawCurrentLoadIrq: 0,
rawCurrentLoadSteal: 0,
rawCurrentLoadGuest: 0,
cpus: [
{
load: 13.725490196078432,
@ -196,12 +218,16 @@ si.currentLoad().then(data => console.log(data));</code></pre class="example">
loadNice: 0,
loadIdle: 86.27450980392157,
loadIrq: 0,
loadSteal: 0,
loadGuest: 0,
rawLoad: 140,
rawLoadUser: 80,
rawLoadSystem: 60,
rawLoadNice: 0,
rawLoadIdle: 880,
rawLoadIrq: 0
rawLoadSteal: 0
rawLoadGuest: 0
},
...
]
@ -769,4 +795,4 @@ si.services('mysql, postgres').then(data => console.log(data));</code></pre clas
</script>
</body>
</html>
</html>

8
lib/index.d.ts vendored
View File

@ -591,12 +591,16 @@ export namespace Systeminformation {
currentLoadNice: number;
currentLoadIdle: number;
currentLoadIrq: number;
currentLoadSteal: number;
currentLoadGuest: number;
rawCurrentLoad: number;
rawCurrentLoadUser: number;
rawCurrentLoadSystem: number;
rawCurrentLoadNice: number;
rawCurrentLoadIdle: number;
rawCurrentLoadIrq: number;
rawCurrentLoadSteal: number;
rawCurrentLoadGuest: number;
cpus: CurrentLoadCpuData[];
}
@ -607,12 +611,16 @@ export namespace Systeminformation {
loadNice: number;
loadIdle: number;
loadIrq: number;
loadSteal: number;
loadGuest: number;
rawLoad: number;
rawLoadUser: number;
rawLoadSystem: number;
rawLoadNice: number;
rawLoadIdle: number;
rawLoadIrq: number;
rawLoadSteal: number;
rawLoadGuest: number;
}
interface ProcessesData {

View File

@ -345,6 +345,7 @@ function parseWifiDarwin(wifiObj) {
const signalLevel = wifiItem.RSSI;
let security = [];
let wpaFlags = [];
let ssid = wifiItem.SSID_STR || '';
if (wifiItem.WPA_IE) {
security.push('WPA');
if (wifiItem.WPA_IE.IE_KEY_WPA_UCIPHERS) {
@ -365,9 +366,12 @@ function parseWifiDarwin(wifiObj) {
});
}
}
// if (wifiItem.SSID) {
// ssid = Buffer.from(wifiItem.SSID, 'base64').toString('utf8');
// }
result.push({
ssid: wifiItem.SSID_STR,
bssid: wifiItem.BSSID,
ssid,
bssid: wifiItem.BSSID || '',
mode: '',
channel: wifiItem.CHANNEL,
frequency: wifiFrequencyFromChannel(wifiItem.CHANNEL),