node package manager
Love JavaScript? Your insights can make it even better. Take the 2017 JavaScript Ecosystem Survey »



This is an alternative port of Coda Hale's metrics library.

I created this because I did not like the existing metrics port, which makes too many (bad) assumptions that aren't present in the original library. However, this is not a 1:1 port either as I have tried to use node idioms for most things.


Here is a simple example that measures the requests / second for a http server:

var metrics = require('better-metrics'));
var meter   = new metrics.Meter();
var http = require('http');
http.createServer(function(req, res) {

Now this just measures things, but does not give you any way to look at the results. But fear not, logging this information is really simple:

setTimeout(function() {
}, 1000);

This will print something like this:


  • Finish Readme : )
  • Re-write Histogram and involved classes, took them from the original metrics library as I had to get those ready in a hurry for something : ).