ConradIrwin/async-profile

Profiling ends immediately

skerit opened this issue · 1 comments

I must be misunderstanding something, but wherever I use async-profiler it doesn't actually profile anything. I immediately get the result, like this:

total: 0.009ms (in 2.350ms real time, CPU load: 0.0, wait time: 4.299ms)
2.348: 0.002ms  at AsyncProfile.create (/srv/www/node_modules/async-profile/lib/index.js:61:27) (0.000)  
2.352: 0.002ms  at AsyncProfile.create (/srv/www/node_modules/async-profile/lib/index.js:61:27) (0.000)  
2.356: 0.003ms  at AsyncProfile.create (/srv/www/node_modules/async-profile/lib/index.js:61:27) (0.000)  
2.361: 0.002ms  at AsyncProfile.create (/srv/www/node_modules/async-profile/lib/index.js:61:27) (0.000)

Now, most of my callbacks are truly asynchronous, there are multiple setImmediate calls down the line. I guess it should be able to catch these, because otherwise there isn't a lot of 'async' about it, right?

I've also tried the advanced configuration (where I call p.stop() in the final callback) but no dice.

Can you gist your code? Which version of node are you using?