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

statsd-agent-js

v2.0.0

Published

Statsd client to monitor CPU, Memory, Disk and Network based on Node JS

Downloads

12

Readme

statsd-agent

Statsd client to monitor CPU, Memory, Disk and Network based on Node JS

Installation

git clone https://github.com/eranbetzalel/statsd-agent-js.git

Configuration

The configuration is loaded from config.custom.js. If the file does not exists - it will be created from config.default.js.

  • monitorFilenames - The monitor filenames relative to the monitors directory.
    • Default: ['cpu-monitor', 'memory-monitor', 'disk-monitor', 'network-monitor']
  • collectStatisticsInterval - The time interval (ms) to collect statistics.
    • Default: 10000
  • sendStatisticsInterval - The time interval (ms) to send statistics.
    • Default: 10000
  • statsdConfig - The statsd-client package configuration
    • host (default: 'localhost') - Where to send the stats
    • prefix (default: 'system') - Prefix all stats with this value
    • debug (default: 'false') - Print what is being sent to stderr
  • statisticBlackList - Array of statistic names ([monitor].[statistic]) to ignore while sending data to statsd.
    • Example: ['memory.used']

Running/Stopping (Linux)

Use forever service to install the agent as linux service.

sudo forever-service install statsd-agent-js -s src/app.js

Use the following commands to run/stop statsd-agent-js:

service statsd-agent-js start
service statsd-agent-js stop
service statsd-agent-js restart
service statsd-agent-js status

Running/Stopping (Windows)

Working on it...

Monitors

A monitor has 2 purposes collect and send statistics. The statsd name pattern is "hostname.monitor.statistic".

The package delivers with the following monitors:

  • CPU - Sends the usage percentage of the common CPU states.
    • cpu.user - running user space processes (%)
    • cpu.nice - running niced (priority) processes (%)
    • cpu.sys - running the kernel (%)
    • cpu.idle - processor was idle (%)
    • cpu.irq - idle while waiting for an I/O operation to complete (%).
  • Memory - Sends the memory usage and total
    • memory.total - total memory (bytes)
    • memory.free - free memory (bytes)
    • memory.used - used memory (bytes)
  • Disk - Sends the usage percentage for any available mount points.
    • disk.[mount-point].total - total memory (bytes)
    • disk.[mount-point].free - free memory (bytes)
    • disk.[mount-point].used - used memory (bytes)
  • Network - Sends a count of the current connection states.
    • network.established - The socket has an established connection
    • network.syn_sent - The socket is actively attempting to establish a connection
    • network.syn_recv - A connection request has been received from the network
    • network.fin_wait1 - The socket is closed, and the connection is shutting down
    • network.fin_wait2 - Connection is closed, and the socket is waiting for a shutdown from the remote end
    • network.time_wait - The socket is waiting after close to handle packets still in the network
    • network.close - The socket is not being used
    • network.close_wait - The remote end has shut down, waiting for the socket to close
    • network.last_ack - The remote end has shut down, and the socket is closed. Waiting for acknowledgement
    • network.listen - The socket is listening for incoming connections
    • network.closing - Both sockets are shut down but we still don't have all our data sent
    • network.unknown - The state of the socket is unknown