Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including dog-statsy with all npm packages installed. Try it out:

var dogStatsy = require("dog-statsy")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

dog-statsy v1.2.1

dogstatsd client

dog-statsy Circle CI

A dogstatsd client.


$ npm install dog-statsy


var Client = require('dog-statsy');
var http = require('http');
var stats = new Client;

  var start = new Date;
  http.get('', function(err, res){
    var ms = new Date - start;
    stats.histogram('request.duration', ms, ['request:yahoo']);
}, 1000);



Initialize a client with the given options:

  • host [localhost]
  • port [8125]
  • prefix optional prefix ('.' is appended)
  • tags array of tags to include in every call
  • bufferSize optional buffer size, if not defined, it will send the data immediately
  • flushInterval optional, only valid when bufferSize is defined. It will flush the buffer after the interval in miliseconds (if not empty)

.gauge(name, val, [tags])

Send gauge value.

.meter(name, val, [tags])

Send meter value.

.set(name, val, [tags])

Send set value.

.count(name, val, [tags])

Send count value.

.incr(name, [val], [tags])

Increment by val or 1.

.decr(name, [val], [tags])

Decrement by val or 1.

.histogram(name, val, [tags])

Send histogram value.


Return histogram delta function.

.timer(name, val, [tags])

Send timer value.


Return timer delta function.

.trace(name, [tags])

Return a trace object.


.step(name, [tags])

Adds a step to a trace.


Completes a trace.




RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free