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

strong-statsd

v2.0.7

Published

statsd wrapper for strong-agent backends

Downloads

597

Readme

strong-statsd

Control a statsd child process.

Uses strongloop-forks/strong-fork-statsd, a fork of etsy/statsd with support for being controlled by a parent process.

Usage

Statsd = require('strong-statsd')

Constructor.

statsd = Statsd(options)

Options:

  • debug: cause statsd to log debug messages
  • scope: prefix to add before all metric names (default is "", but also, if the statsd: backend URL is used, it can provide a scope that will override this option)
  • expandScope: function to call on scope before using it as a prefix
  • flushInterval: accumulated metrics will be processed and emitted at this interval, in seconds (default is 15)

statsd.backend(url)

Specify one or more backends.

Backend URL formats:

  • statsd://[<host>][:<port>]: publish metrics to a statsd receiver. The host defaults to "localhost", and the port defaults to 8125.

  • log:[<file>]: log metrics to FILE, which may be - to indicate stdout (FILE defaults to -). Format is ISOTIMESTAMP METRIC=VALUE (TYPE), where TYPE is one of count, gauge, or ms (a timer interval in milliseconds).

  • debug:[?pretty[=<true|false>]]: json dump to stdout for testing and debugging backends. Pretty output is formatted as multi-line with color, otherwise it's single line.

  • graphite://[<host>][:<port>]: forward to graphite, host defaults to "localhost", port defaults to 2003

  • syslog:[?[application=<application>][&priority=<priority>]: write to local system log using syslog(3). The application defaults to "statsd", and priority defaults to "LOG_INFO", but can be set to any of "LOG_DEBUG", "LOG_INFO", "LOG_NOTICE", "LOG_WARNING", or "LOG_CRIT".

  • splunk://[<host>]:<port>: write using a UDP key value protocol to splunk, host defaults to localhost, and port is mandatory, since the protocol has no assigned port.

Throws on error in URL format, returns self on success.

statsd.start(callback)

Starts statsd child process, callback indicates when it is started, and the statsd port is known.

statsd.port

The port that the statsd server is listening on.

statsd.url

A statsd: URL that contains the PORT and (unexpanded) scope that should be published to. The publish is usually done by .send(), but this URL may be useful for display or debug purposes.

statsd.send(name, value)

Send statsd metric with name and value. Metrics are discarded until statsd is started.

statsd.stop(callback)

Stop the statsd child, callback indicates it has exited.

Stopping is optional, the child will self-exit when the parent process exits.