0.1.0 • Published 9 years ago

performace-analyst v0.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

node-performance-analyst

spit out performance metrics about functions you want to measure the performance of

var seneca = require('seneca')

var PerfAnalyst = require('performance-analyst')

var perfAnalyst = PerfAnalyst.wrap(seneca, 'add')

perfAnalyst.on('metric', function(functionInfo, timeInMilliseconds) {

  functionInfo // { fileName: '....', line: '....', name: '....' }
  timeInMilliseconds // the time it took the function until the callback was invoked

})


seneca.add({...}, function myAnalyzedFunction(args, callback) {

  // do stuff
  callback()

});