npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dope-system-metrics

v1.2.1

Published

System sensors for Linux

Downloads

6

Readme

dope-system-metrics

Open source sensors for Linux.

Open bash terminal:

npm install dope-system-metrics

Create file sensors.js

const Sensor = require('dope-system-metrics');
var   sensor = new Sensor({ delta:2000, rootPath:'system'});
sensor.on(sensor.events.DATA,(data) => {
    data.map((row) => {
         // write result to standard output
         process.stdout.write(row.name + ' ' + row.value + ' ' + row.time  + "\n");
    });
});
// Uncomment desired method:
// sensor.runOnce();
// sensor.runOnceDelta();
// sensor.runForever();

Available methods:

  • runOnce (outputs data that does not represent deviation):

const Sensor = require('dope-system-metrics');
var   sensor = new Sensor();
      sensor.on(sensor.events.DATA,console.log);
      sensor.runOnce();
  • runOnceDelta (ouputs data end exits on first iteration):
const Sensor = require('dope-system-metrics');
var   sensor = new Sensor();
      sensor.on(sensor.events.DATA,console.log);
      sensor.runOnceDelta();
  • runForever (constantly ouputs data):
const Sensor = require('dope-system-metrics');
var   sensor = new Sensor();
      sensor.on(sensor.events.DATA,console.log);
      sensor.runForever();

Options:

  • rootPath: first part of the name ( before first '.')
  • host: name of the host ( default is HOSTNAME environment variable ).
  • delta: time im milliseconds to check for deviation ( default is 2 sec. ).
  • timeServer: ( timeserver to check time against ).
  • timeServerCheckInterval: ( interval to perform the check in seconds. default is 12 hours ).
  • precision: ( precision of metric value. default is 2).

Execute:

  • As standalone linux app.
dope-sys-monitor
  • In graphite compatibility mode.
dope-sys-metrics

Metrics.

  • arp.*: (*ip as integer) Sends ipv4 (int) as metric name and mac addr as integer.
  • cpu*.clock: (*cpu number) Current Cpu clock speed.
  • cpu*.idle: (*cpu number) Current Cpu idle.
  • cpu*.nice: (*cpu number) Current Cpu nice.
  • cpu*.system: (*cpu number) Current Cpu system load.
  • cpu*.user: (*cpu number) Current Cpu user load.
  • cpu.idle: Total Cpu idle.
  • cpu.nice: Total Cpu nice.
  • cpu.system: Total Cpu system load.
  • cpu.user: Total cpu user load.
  • disk.*.usage.free: (*disk name) Current disk free space.
  • disk.*.usage.percent: (*disk name) Current disk free space as percents.
  • disk.*.usage.used: (*disk name) Current disk used space.
  • disk.*.writespeed: (*disk name) Current disk writespeed.
  • mem.free: System memory free.
  • mem.used: System memory used.
  • net.*.rx: (*interface) Current interface receive speed.
  • net.*.tx: (*interface) Current interface trasmit speed.
  • net.tcp.close:
  • net.tcp.close_wait:
  • net.tcp.closing:
  • net.tcp.established:
  • net.tcp.fin_wait1:
  • net.tcp.fin_wait2:
  • net.tcp.last_ack:
  • net.tcp.listen:
  • net.tcp.syn_recv:
  • net.tcp.syn_sent:
  • net.tcp.time_wait:
  • openedfilehandlers: Opened file handlers by kernel.
  • ping.gateway: Ping to the gateway.
  • prc.*.instances: (*process name) Current process. Number of instances.
  • procs.blocked: Processes blocked on CPU.
  • procs.running: Processes running on CPU.
  • procstotal: Total processes.
  • procszombie: Number of zombie processes.
  • random.entropy: Available entropy.
  • random.pool: Randomness pool size.
  • service.*.80: (*service name) Current service. Used port.
  • terminals: Number of terminals opened.
  • threads: Number of threads.
  • uptime.boot: Uptime ( since boot ).
  • uptime.load: System load ( returned by uptime command )
  • users.*.numprocs: (*user's name) Number of processes per user.
  • time.sync: Time diff. of current machine, compared to remote server.
  • watcher: System file ( by default: kernel's log ) watcher ( displays changes, a.k.a. new lines ).