From c3b53df529890fe617508f521be102fbc3505641 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Fri, 25 Aug 2023 08:03:35 +0200 Subject: [PATCH] mem() added writeback and dirty (linux) --- CHANGELOG.md | 1 + README.md | 3 +++ docs/changes.html | 5 ++++- docs/history.html | 5 +++++ docs/index.html | 2 +- docs/memory.html | 22 +++++++++++++++++++++- lib/index.d.ts | 2 ++ lib/memory.js | 8 +++++++- 8 files changed, 44 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 7fe13c4..a3acec4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 | diff --git a/README.md b/README.md index f42efb0..42739ee 100644 --- a/README.md +++ b/README.md @@ -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 | diff --git a/docs/changes.html b/docs/changes.html index 5a1cec7..076ba40 100644 --- a/docs/changes.html +++ b/docs/changes.html @@ -175,13 +175,16 @@
  • cpu(): added virtualization if cpu supports virtualization
  • cpu(): now flags are part of this function
  • cpuTemperature(): added socket and chipset temperature (linux)
  • +
  • currentLoad(): added steal and guest time (linux)
  • disksIO(): added waitTime, waitPercent (linux)
  • +
  • fsSize(): added optional drive parameter
  • fsSize(): added available
  • fsSize(): improved calculation of used
  • getData(): support for passing parameters and filters (see section General / getData)
  • graphics(): extended properties macOS
  • graphics(): extended nvidia-smi parsing
  • networkInterfaces(): type detection improved (win - wireless)
  • +
  • mem(): added writeback and dirty (linux)
  • memLayout(): extended manufacturer list (decoding)
  • memLayout(): added ECC flag
  • osInfo(): better fqdn (win)
  • @@ -284,4 +287,4 @@ - \ No newline at end of file + diff --git a/docs/history.html b/docs/history.html index 495ec34..5e89673 100644 --- a/docs/history.html +++ b/docs/history.html @@ -57,6 +57,11 @@ + + new 5.20.0 + 2023-08-25 + mem() new properties writeback and dirty (linux) + 5.19.1 2023-08-23 diff --git a/docs/index.html b/docs/index.html index 169a82e..8930cc8 100644 --- a/docs/index.html +++ b/docs/index.html @@ -170,7 +170,7 @@
    systeminformation
     
    -
    New Version: 5.19.1
    +
    New Version: 5.20.0
    diff --git a/docs/memory.html b/docs/memory.html index 455cecb..52ae25a 100644 --- a/docs/memory.html +++ b/docs/memory.html @@ -197,6 +197,26 @@ X + + + writeback + X + + + + + + + + + dirty + X + + + + + + @@ -443,4 +463,4 @@ si.memLayout().then(data => console.log(data)); - \ No newline at end of file + diff --git a/lib/index.d.ts b/lib/index.d.ts index 86ba6d8..408af37 100644 --- a/lib/index.d.ts +++ b/lib/index.d.ts @@ -126,6 +126,8 @@ export namespace Systeminformation { swaptotal: number; swapused: number; swapfree: number; + writeback: number | null; + dirty: number | null; } interface MemLayoutData { diff --git a/lib/memory.js b/lib/memory.js index 54dd64c..80b6e23 100644 --- a/lib/memory.js +++ b/lib/memory.js @@ -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);