Skip to content

Commit

Permalink
mem() added writeback and dirty (linux)
Browse files Browse the repository at this point in the history
  • Loading branch information
sebhildebrandt committed Aug 25, 2023
1 parent 5cfe84a commit c3b53df
Show file tree
Hide file tree
Showing 8 changed files with 44 additions and 4 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.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 |
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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 |
Expand Down
5 changes: 4 additions & 1 deletion docs/changes.html
Original file line number Diff line number Diff line change
Expand Up @@ -175,13 +175,16 @@ <h4>Other Improvements and Changes</h4>
<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>
Expand Down Expand Up @@ -284,4 +287,4 @@ <h2>Full Version History</h2>

</body>

</html>
</html>
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>
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>
Expand Down
2 changes: 1 addition & 1 deletion 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.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">
Expand Down
22 changes: 21 additions & 1 deletion docs/memory.html
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,26 @@ <h2>System Memory and Memory Layout</h2>
<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">
Expand Down Expand Up @@ -443,4 +463,4 @@ <h5>Example</h5>
</script>
</body>

</html>
</html>
2 changes: 2 additions & 0 deletions lib/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ export namespace Systeminformation {
swaptotal: number;
swapused: number;
swapfree: number;
writeback: number | null;
dirty: number | null;
}

interface MemLayoutData {
Expand Down
8 changes: 7 additions & 1 deletion lib/memory.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,9 @@ function mem(callback) {

swaptotal: 0,
swapused: 0,
swapfree: 0
swapfree: 0,
writeback: null,
dirty: null
};

if (_linux) {
Expand Down Expand Up @@ -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);
Expand Down

0 comments on commit c3b53df

Please sign in to comment.