From 0164a65c2074b9947666735d99cf12ddd957bca7 Mon Sep 17 00:00:00 2001 From: Sebastian Hildebrandt Date: Tue, 28 Jan 2020 00:20:42 +0100 Subject: [PATCH] updated docs --- docs/processes.html | 19 +++++++++++++++++++ docs/statsfunctions.html | 2 +- 2 files changed, 20 insertions(+), 1 deletion(-) diff --git a/docs/processes.html b/docs/processes.html index f427333..4f3150a 100644 --- a/docs/processes.html +++ b/docs/processes.html @@ -557,6 +557,25 @@ +

Getting correct stats values

+ +

In currentLoad() the + results are calculated correctly beginning with the second call of the function. + It is determined by calculating the difference of cpu ticks between two calls of the function.

+ +

The first time you are calling one of this functions, you will get the load since cpu uptime. + The second time, you should then get statistics based cpu ticks between the two calls ...

+ +

So basically, your code should look like this:

+ +
const si = require('systeminformation');
+
+              setInterval(function() {
+                  si.currentLoad().then(data => {
+                      console.log(data);
+                  })
+              }, 1000)
+

Beginning with the second call, you get precise load values between the two calls.

diff --git a/docs/statsfunctions.html b/docs/statsfunctions.html index b97992f..c0f4bf7 100644 --- a/docs/statsfunctions.html +++ b/docs/statsfunctions.html @@ -48,7 +48,7 @@

Getting correct stats values

-

In fsStats(), disksIO() and networkStats() the +

In fsStats(), disksIO(), currentLoad() and networkStats() the results / sec. values (rx_sec, IOPS, ...) are calculated correctly beginning with the second call of the function. It is determined by calculating the difference of transferred bytes / IOs divided by the time between two calls of the function.