0.1.0 • Published 7 years ago

akyuu-adapter-statsd v0.1.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

akyuu-adapter-statsd

StatsD adapter for Akyuujs.

Installation

$ npm install --save -d akyuu-adapter-statsd

Configuration

Make sure you have a connections section in your configuration file(s).
And its adapter should be statsd.

optionrequiredremark
adaptermust be statsd
hostdefault 127.0.0.1
portdefault 8125
...docs

Usage

Config File

// ${project}/config/default/connections.js

'use strict'

module.exports = {
    myStatsd: {
        adapter: 'statsd',
        host: '127.0.0.1',
        port: 8125
    }
}

Usage File

// ${project}/${some}.js

'use strict'

const akyuu = require('akyuu');
const myStatsd = akyuu.config.connection.get('myStatsd');

myStatsd.socket.on('error', function(error) {
    console.log(error);
});


statsd.increment('some_key');
statsd.timing('some_key', 100);