systeminformation/docs/statsfunctions.html
Sebastian Hildebrandt a9f346a69a adding website
2019-01-09 20:40:33 +01:00

105 lines
4.2 KiB
HTML

<!doctype html>
<html lang="en">
<head>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.3/css/bootstrap.min.css" integrity="sha384-MCw98/SFnGE8fJT3GXwEOngsV7Zt27NXFoaoApmYm81iuXoPkFOJwJ8ERdknLPMO" crossorigin="anonymous">
<link rel="stylesheet" href="https://pro.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-LRlmVvLKVApDVGuspQFnRQJjkv0P7/YFrw84YYQtmYG4nK8c+M+NlmYDCv0rKWpG" crossorigin="anonymous">
<link rel="stylesheet" href="styles.css">
<script src="main.js"></script>
<title>systeminformation</title>
</head>
<body>
<nav class="nav" style="background-image: url('./assets/trianglify.png');">
<div class="container">
<a href="/"><img class="logo float-left" src="assets/logo.png">
<div class="title float-left">systeminformation</div>
</a>
<div class="text float-right"><a href="https://github.com/sebhildebrandt/systeminformation">View on Github <i class="fab fa-github"></i></a></div>
</div>
</nav>
<section class="container">
<div class="row">
<div class="col-12 col-md-4 col-lg-3 col-xl-2 menu" id="menu">
</div>
<div class="col-12 col-md-8 col-lg-9 col-xl-10 content">
<div class="row">
<div class="col-12 sectionheader">
<div class="title">Stats Functions</div>
<div class="text">
<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
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>
<p>The first time you are calling one of this functions, you will get <span class="code">-1</span> for transfer rates.
The second time, you should then get statistics based on the time between the two calls ...</p>
<p>So basically, if you e.g. need a values for network stats every second, your code should look like this:</p>
<pre>const si = require('systeminformation');
setInterval(function() {
si.networkStats().then(data => {
console.log(data);
})
}, 1000)</pre>
<p>Beginning with the second call, you get network transfer values per second.</p>
</div>
</div>
</div>
</div>
</div>
</div>
</section>
<footer class="container-fluid">
<div class="container">
<div class="row">
<div class="col-lg-4 col-12">
<ul class="list-unstyled">
<li><a href="/">Home</a></li>
<li><a href="https://github.com/sebhildebrandt/systeminformation">Github <i class="fab fa-github"></i></a></li>
<li><a href="contributors.html">Contributors</a></li>
<li><a href="sponsoring.html">Buy me a coffee</a></li>
</ul>
</div>
<div class="col-lg-4 col-12">
<ul class="list-unstyled">
<li><a href="gettingstarted.html">Quick Start</a></li>
<li><a href="issues.html">Known Issues</a></li>
<li><a href="statsfunctions.html">Stats Functions</a></li>
<li><a href="history.html">Version history</a></li>
</ul>
</div>
<div class="col-lg-4 col-12">
<ul class="list-unstyled">
<li><a href="https://www.plus-innovations.com">&copy; 2019 Sebastian Hildebrandt, +innovations</a></li>
<li><a href="/copyright.html">Copyright &amp; License</a></li>
<li><a href="/trademarks.html">Trademarks</a></li>
<li><a href="https://github.com/sebhildebrandt/systeminformation/blob/master/LICENSE"><img src="https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square" alt="MIT license" /></a></li>
</ul>
</div>
</div>
</div>
</footer>
<script>
window.onload = function (e) {
createMenu();
}
</script>
</body>
</html>