statsd-socket.io
StatsD backend to emit stats over socket.io. This backend allows you to subscribe to individual stats, groups of stats, or all stats and handle them in real time.
Installation
There are a few ways to install statsd-socket.io
to be used as a StatsD backend. You can add it to the StatsD package.json
and run npm install
.
The simplest way to install the module is to run:
$ npm install statsd-socket.io
Requirements
Configuration
To add this backend to the StatsD daemon, simply add the following settings to the StatsD configuration file:
socketPort: 8000 backends: 'statsd-socket.io'
If you want to keep the graphite backend installed, you need to include './backends/graphite'
in the backends configuration.
Usage
var socket = ;socket; // Retrieve all statssocket; // Retrieve a groups of statssocket; // Retrieve a single statsocket; // Supports wildcardssocket;
This example shows using socket.io on the server side but can just as easily be implemented on the client side. See the socket.io documentation for more information.
Tests
To run the tests:
npm test