statsd-socket.io

StatsD backend to emit stats over socket.io

statsd-socket.io

StatsD backend to emit stats over socket.io

There are a few ways to install statsd-socket.io to be used with StatsD. You can add it to the StatsD package.json and run npm install.

To simply install the module, just run:

  $ npm install statsd-socket.io

To add this backend to the StatsD daemon, simply add the following settings to you StatsD configuration file:

{
  socketPort: <port>,
  backends: ['statsd-socket.io']
}
  • NOTE: If you want to keep the graphite backend installed, you need to include './backends/graphite' in the backends array
var socket = require('socket.io-client').connect('http://localhost:5555')
socket.on('connect', function () {
  socket.emit('subscribe', 'all');
  socket.emit('subscribe', 'gauges.server.cpu');
});
 
socket.on('all', function (data) {
  console.log('ALL:' + data);
});
 
socket.on('gauges.server.cpu', function (data) {
  console.log('Server CPU:' + data);
});

To run the tests:

npm test