racker/node-rackspace-shared-utils — pull request #10 by jirwin (2013-03-11 23:10:41+00:00)
Title: RFR: RecordWork instrument type for timing and counting generic functions

This new type in the instruments library lets you count and time a function call in a generic fashion.

You can use this a couple of different ways:

More explicity:
```javascript
function doSomeExpensiveOp(err, callback) {
var timer = new RecordWork('do.some.expensive.op', callback);
// You can explicitly get a mutated callback
callback = timer.getCallback();
timer.startWork();

// timer will automatically stop when the callback is invoked.
callback();
}
```

Shortcut:
```javascript
function doSomeExpensiveOp(err, callback) {
// Create and start the timer, and return the mutated callback
callback = new RecordWork('do.some.expensive.op', callback).startWork();

callback();
}
```