0.1.1 • Published 10 years ago

pstats v0.1.1

Weekly downloads
4
License
MIT
Repository
github
Last release
10 years ago

This module applies patches Q library to extend promises with stats method.

var StatsD = require('node-statsd').StatsD;
var statsClient = new StatsD({prefix: 'project.'});

require('pstats')(statsClient);

longAsyncOperation()
    .then(anotherLongAsyncOperation)
    .stats('operations.xxx');

This will send following stats to graphite:

Counters:
    project.operations.xxx.attempted +1
    project.operations.xxx.succeeded +1
    or
    project.operations.xxx.failed +1
Timing:
    project.operations.xxx dt

Start time is the moment when your promise chain is being constructed (stats method called).

0.1.1

10 years ago

0.1.0

10 years ago