So, you want to profile function calls (trace and time them) on a live app?

If not, I’d suggest looking at Node profiler + flame graphs, e.g. with flamebearer library. Data collected by these tools give a good picture of what’s going on in the app and where potential bottlenecks are.

If you want to profile a live app with minimal configuration and boilerplate, then it’s much more tricky. I can’t imagine a good way to archive it with Async Hooks API or something else at the moment, but the problem sounds interesting and I’ll think of it a bit more in the next couple of days.

Distributed systems gazer. Node.js contributor. Occasional tech blogger and speaker.

Distributed systems gazer. Node.js contributor. Occasional tech blogger and speaker.