updated docs
This commit is contained in:
parent
0c15f45ef6
commit
0164a65c20
@ -557,6 +557,25 @@
|
|||||||
</tr>
|
</tr>
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</table>
|
||||||
|
<h4>Getting correct stats values</h4>
|
||||||
|
|
||||||
|
<p>In <span class="code">currentLoad()</span> the
|
||||||
|
results are calculated correctly beginning with the <strong>second</strong> call of the function.
|
||||||
|
It is determined by calculating the difference of cpu ticks between two calls of the function.</p>
|
||||||
|
|
||||||
|
<p>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 ...</p>
|
||||||
|
|
||||||
|
<p>So basically, your code should look like this:</p>
|
||||||
|
|
||||||
|
<pre><code class="js">const si = require('systeminformation');
|
||||||
|
|
||||||
|
setInterval(function() {
|
||||||
|
si.currentLoad().then(data => {
|
||||||
|
console.log(data);
|
||||||
|
})
|
||||||
|
}, 1000)</code></pre>
|
||||||
|
<p>Beginning with the second call, you get precise load values between the two calls.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@ -48,7 +48,7 @@
|
|||||||
<div class="text">
|
<div class="text">
|
||||||
<h4>Getting correct stats values</h4>
|
<h4>Getting correct stats values</h4>
|
||||||
|
|
||||||
<p>In <span class="code">fsStats()</span>, <span class="code">disksIO()</span> and <span class="code">networkStats()</span> the
|
<p>In <span class="code">fsStats()</span>, <span class="code">disksIO()</span>, <span class="code">currentLoad()</span> and <span class="code">networkStats()</span> the
|
||||||
results / sec. values (rx_sec, IOPS, ...) are calculated correctly beginning with the <strong>second</strong> call of the function.
|
results / sec. values (rx_sec, IOPS, ...) are calculated correctly beginning with the <strong>second</strong> 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.</p>
|
It is determined by calculating the difference of transferred bytes / IOs divided by the time between two calls of the function.</p>
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user