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

numbat-collector

v1.7.1

Published

numbat-powered metrics collector & redirector

Downloads

45

Readme

Numbat

Numbat-Powered Metrics system: monitoring, alerting, and historical analysis. The collector sits in front of Numbat-Analyzer and InfluxDB in the same way that statsd sits in front of Graphite. This system, however, does absolutely no aggregation or manipulation of the data at all (yet). It merely multiplexes & buffers when necessary.

See numbat-analyzer for more information on the system.

The collector is a service. You are intended to run it anywhere you like, perhaps many instances of it. You could run one on every hosts where you run services and communicate with it using a socket. Or you could run a few collectors and communicate using TCP or UDP.

npm Tests Coverage Dependencies

In production at npm.

Running

> npm install -g numbat-collector
> numbatd configuration.js

The configuration file looks like this:

module.exports =
{
    logging:
    {
        name: 'numbat-1',
        silent: false
    },
    listen: { host: 'localhost', port: 3333 },
    outputs:
    [
        { type: 'log', name: 'numbat-1', path: './numbat.log' },
        { type: 'analyzer',  host: 'localhost', port: 5555 },
        {
            type: 'influxdb',
            hosts:
            [
                { host: 'influx-1.example.com',  port: 8086 },
                { host: 'influx-2.example.com',  port: 8086 },
            ],
            username: 'numbat',
            password: 'my-top-secret',
            database: 'numbat'
        },
        { type: 'prettylog', name: 'foobar' },
        { type: 'graphite', host: 'localhost', port: 3333 },
    ]
};

The configuration options are described in more detail below.

Logging options

Logs JSON-formatted data to the console by default.

  • name: nodename: name to tag all log entries with
  • silent: true: no logging at all
  • NODE_ENV=dev set in environment: log to console, pretty-printed (no need to pipe to bistre)

Listen options

  • listen: { host: '0.0.0.0', port: 3333 } -- listen for incoming data over tcp on the given port
  • listen: { host: 'localhost', port: 3333, udp: true } -- listen for udp data
  • listen: { path: '/path/to/foo.sock' } -- connect to the given unix domain socket
  • listen: { host: '0.0.0.0', port: 3333, ws: true } -- listen for incoming data over a websocket on the given port

These options are mutually exclusive.

Websocket specific options

Some running environments restrict the use of raw TCP or UDP sockets. In those situations you might use the websocket transport option instead. For example, certain PaaS providers restrict this. Use this for server-to-server communication, not browser-to-server communication.

The websocket listener obeys these listener options:

When using the websocket option, the following additional parameters can be provided on the listener:

  • pathname -- the path the websocket should be exposed at - default: '/'
  • keepAliveFrequency -- how often in milliseconds the server and client should exchange keep alive messages - default: 3000
  • keepAliveThreshold -- how many keep alive messages to be dropped before the socket connection is reset - default: 2
  • verifyClient -- a custom function to validate client access example - default: no validation

Outputs

  • influx: InfluxDB 0.9, client provided by the numbat-influx module
  • logfile: a json-formatted logfile (using bole); in case you want logging for any reason
  • prettylog: a pretty-formatted colorized console log
  • analyzer: numbat-analyzer, the incomplete alerting & monitoring component of the numbat-powered metrics system.
  • graphite: Graphite (plain graphite, not statsd)

You can have as many outputs as you want.

Contributing

Yes, please do! See our contributing guide for basic rules of engagement.

License

ISC