mem() added writeback and dirty (linux)

This commit is contained in:
Sebastian Hildebrandt 2023-08-25 08:03:35 +02:00
parent 5cfe84a043
commit c3b53df529
8 changed files with 44 additions and 4 deletions

View File

@ -83,6 +83,7 @@ For major (breaking) changes - **version 4, 3 and 2** - see end of page.
| Version | Date | Comment |
| ------- | ---------- | --------------------------------------------------------------------------------------------------- |
| 5.20.0 | 2023-08-25 | `mem()` added writenack and dirty (linux) |
| 5.19.1 | 2023-08-23 | `wifiNetworks()` improved SSID parsing (macOS) |
| 5.19.0 | 2023-08-22 | `currentLoad()` added steal and guest time (linux) |
| 5.18.15 | 2023-08-10 | `npm` command extended |

View File

@ -128,6 +128,7 @@ si.cpu()
(last 7 major and minor version releases)
- Version 5.20.0: `mem()` added writeback and dirty (linux)
- 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 (macOS)
@ -283,6 +284,8 @@ Full function reference with examples can be found at [https://systeminformation
| | swaptotal | X | X | X | X | X | |
| | swapused | X | X | X | X | X | |
| | swapfree | X | X | X | X | X | |
| | writeback | X | | | | | |
| | dirty | X | | | | | |
| si.memLayout(cb) | [{...}] | X | X | X | X | | Memory Layout (array) |
| | [0].size | X | X | X | X | | size in bytes |
| | [0].bank | X | X | | X | | memory bank |

View File

@ -175,13 +175,16 @@
<li><span class="code">cpu()</span>: added <span class="code">virtualization</span> if cpu supports virtualization</li>
<li><span class="code">cpu()</span>: now <span class="code">flags</span> are part of this function</li>
<li><span class="code">cpuTemperature()</span>: added socket and chipset temperature (linux)</li>
<li><span class="code">currentLoad()</span>: added <span class="code">steal</span> and <span class="code">guest</span> time (linux)</li>
<li><span class="code">disksIO()</span>: added <span class="code">waitTime</span>, <span class="code">waitPercent</span> (linux)</li>
<li><span class="code">fsSize()</span>: added optional drive parameter</li>
<li><span class="code">fsSize()</span>: added <span class="code">available</span></li>
<li><span class="code">fsSize()</span>: improved calculation of <span class="code">used</span></li>
<li><span class="code">getData()</span>: support for passing parameters and filters (see <a href="general.html">section General / getData</a>)</li>
<li><span class="code">graphics()</span>: extended properties macOS</li>
<li><span class="code">graphics()</span>: extended nvidia-smi parsing</li>
<li><span class="code">networkInterfaces()</span>: type detection improved (win - wireless)</li>
<li><span class="code">mem()</span>: added <span class="code">writeback</span> and <span class="code">dirty</span> (linux)</li>
<li><span class="code">memLayout()</span>: extended manufacturer list (decoding)</li>
<li><span class="code">memLayout()</span>: added ECC flag</li>
<li><span class="code">osInfo()</span>: better fqdn (win)</li>
@ -284,4 +287,4 @@
</body>
</html>
</html>

View File

@ -57,6 +57,11 @@
</tr>
</thead>
<tbody>
<tr>
new <th scope="row">5.20.0</th>
<td>2023-08-25</td>
<td><span class="code">mem()</span> new properties writeback and dirty (linux)</td>
</tr>
<tr>
<th scope="row">5.19.1</th>
<td>2023-08-23</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.19.1</span></div>
<div class="version">New Version: <span id="version">5.20.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">

View File

@ -197,6 +197,26 @@
<td>X</td>
<td></td>
</tr>
<tr>
<td></td>
<td>writeback</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td></td>
<td>dirty</td>
<td>X</td>
<td></td>
<td></td>
<td></td>
<td></td>
<td></td>
</tr>
<tr class="example">
<td></td>
<td colspan="7">
@ -443,4 +463,4 @@ si.memLayout().then(data => console.log(data));</code></pre class="example">
</script>
</body>
</html>
</html>

2
lib/index.d.ts vendored
View File

@ -126,6 +126,8 @@ export namespace Systeminformation {
swaptotal: number;
swapused: number;
swapfree: number;
writeback: number | null;
dirty: number | null;
}
interface MemLayoutData {

View File

@ -162,7 +162,9 @@ function mem(callback) {
swaptotal: 0,
swapused: 0,
swapfree: 0
swapfree: 0,
writeback: null,
dirty: null
};
if (_linux) {
@ -193,6 +195,10 @@ function mem(callback) {
result.swapfree = parseInt(util.getValue(lines, 'swapfree'), 10);
result.swapfree = result.swapfree ? result.swapfree * 1024 : 0;
result.swapused = result.swaptotal - result.swapfree;
result.writeback = parseInt(util.getValue(lines, 'writeback'), 10);
result.writeback = result.writeback ? result.writeback * 1024 : 0;
result.dirty = parseInt(util.getValue(lines, 'dirty'), 10);
result.dirty = result.dirty ? result.dirty * 1024 : 0;
}
if (callback) { callback(result); }
resolve(result);