instance-stats
Installation
npm install --save instance-stats
Usage
Basics
const instanceStats = ; // Get cpu infolet cpus = instanceStats;console; // Get gpu info. getGpusInfo function return a promiseinstanceStats
Usage observer
This library also provide Observer object for getting CPU and GPU usage.
const instanceStats = ; // Create an observer object which broadcasts infomation every second (1000ms)const observer = 1000; // Listen on CPU eventobserver; // Listen on GPU eventobserver; // Listen on GPU error eventobserver; // Start the observerobserverstart; // Stop the observer after 5 seconds (5000ms);
Getting To Know Yeoman
Yeoman has a heart of gold. He's a person with feelings and opinions, but he's very easy to work with. If you think he's too opinionated, he can be easily convinced. Feel free to learn more about him.
Created with
Yeoman and Generator-simple-package
License
MIT © nghiattran