New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

vmstat-s

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

vmstat-s

parse the vmstat -s result for cpu/mem info on this machine

latest
Source
npmnpm
Version
0.2.0
Version published
Maintainers
1
Created
Source

vmstat-s

Show CPU/mem detailed and summary stats on a linux machine.

Command-line Example

browser support

API Example

In addition to vmstat-s shell command-line, you can also require('vmstat-s') from your node.js application as you wish.

var promise = require('vmstat-s')(); // this return a promise of vmstats instance
promise.then(function (vmstats) {
    console.dir(vmstats.getLastData()); // print out initial (mem usage data only)
    setTimeout(heartbeat, 2*1000); // interval 2 seconds
    function heartbeat() {
      setTimeout(heartbeat, 2*1000);
      vmstats.next()
        .then(console.dir); // print out current data (mem usage data and cpu usage data). Cpu usage is calculated from tick count diffs, thus require at least 2 measures.
    }
});

How it works

This module is based on vmstat -s linux command. It get memory and cpu tick counters with fixed interval and print out summary info to console.

install

With npm do:

npm install vmstat-s -g

license

MIT

Keywords

vmstat

FAQs

Package last updated on 13 Sep 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts