procps-ticker
v0.2.0
Published
Ticks `proc` info of the host machine at given intervals and exposes it via a stream interface.
Downloads
9
Readme
procps-ticker
Ticks proc
info of the host machine at given intervals and exposes it via a stream interface.
var getstat = require('procps-ticker').sysinfo.getstat;
function pad(s) {
return String(' ' + s).slice(-10);
}
function end(stream) {
stream.end();
console.error('\nending');
}
var stream = getstat({ interval: 500 })
stream
.on('error', console.error)
.once('data', function (d) {
var keys = Object.keys(d).map(function (k) { return pad(k) }).join('');
process.stdout.write(keys + '\n');
})
.on('data', function (d) {
var vals = Object.keys(d).map(function (k) { return pad(d[k]) }).join('')
process.stdout.write(vals + '\r');
})
setTimeout(end, 10000, stream);
Table of Contents generated with DocToc
- Installation
- API
- readproctab(opts) → {ReadableStream}
- Stream::end()
- sysinfo::getdiskstat(opts) → {ReadableStream}
- sysinfo::getstat(opts) → {ReadableStream}
- sysinfo::loadavg(opts) → {ReadableStream}
- sysinfo::meminfo(opts) → {ReadableStream}
- sysinfo::uptime(opts) → {ReadableStream}
- sysinfo::uptimeSince(opts) → {ReadableStream}
- sysinfo::vminfo(opts) → {ReadableStream}
- License
Installation
npm install procps-ticker
API
generated with docme
License
MIT