A simple statsd client.
$ npm install statsy
var Client = require('statsy');
var http = require('http');
var stats = new Client;
setInterval(function(){
stats.incr('requests');
var end = stats.timer('request');
http.get('http://yahoo.com', function(err, res){
// do stuff
end();
});
}, 1000);Initialize a client with the given options:
host[localhost]port[8125]prefixoptional prefix ('.' is appended)tcpuse TCP instead of UDP
Events from the socket are forwarded, however by default errors are simply ignored. When TCP is used reconnection attempts will be made until the connection is re-established.
Send gauge value.
Send meter value.
Send set value.
Send count value.
Increment by val or 1.
Decrement by val or 1.
Send histogram value.
Return histogram delta function.
Send timer value.
Return timer delta function.
MIT