graphite client for nodejs
npm install nodegraphite
jasmine
When there is a socket error occurs, the err info will be in event listener.
Initialize a new graphite client.
- port {String}: graphite server port, default is 2003
- host {String}: graphite server host, default is localhost
var GraphiteClient = require('nodegraphite');
var cli = new GraphiteClient();
Write metrics data to grapite server.
- metrics {Object}: data sended to graphite, {metric: value}
- callback {Function}: optional callback function, the callback function will take two parameters (err, data)
cli.once('error', function (err) {
console.error(err);
});
cli.write({foo: 23});
If you use debug
package in your app, you can set DEBUG=graphite
to debug nodegraphite
.