Leverage nodetime to push samples to statsd
Last updated 8 years ago by addisonj .
BSD · Repository · Original npm · Tarball · package.json
$ cnpm install statsd-time 
SYNC missed versions from official npm registry.


Leverage the excellent nodetime library to take samples, and send it off to statsd!


// make sure this is first!
var StatsdTime = require("statsd-time")
var statsdTime = new StatsdTime("myhost:8025")

Is it magic?

Nope! Nodetime ties into lots of core node components and makes measurements. It exposes hooks that allow us to get these samples We ship em off to statsd!

This is a really simple way to get data such as HTTP average request time, Mongodb query counts, etc...

What about CPU/Heap profiling?

You still need to use nodetime for that, but if you are looking to avoid sending data to an external service, use look (


By defauly, statsd-time will do the following for any sample:

Send the operation type as a counter. Send the response time (where applicable)

statsdTime.measure("HTTP", function(sample, statsd) {
// do what you want

// make sure you register BEFORE you call profile!

Initilization Options statsdTime.profile has the following signature:

new StatsdTime(host)
// or
var object = {
  host: "statsdHost", //default: "localhost:8025"
  port: 8025,
  connection: instance, // an open connection to statsD (uses, overrides host
  nodetime_opts: {}, // pased onto nodetime, use stuff like headless: true to turn off external server access
  prefix: "myApp", // default: ""
new StatsdTime(object)
// where object is

Current Tags

  • 0.0.1                                ...           latest (8 years ago)

1 Versions

  • 0.0.1                                ...           8 years ago
Maintainers (1)
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 0
Dependencies (2)
Dev Dependencies (0)
Dependents (0)

Copyright 2014 - 2016 © |