top | item 42583317

(no title)

notcrazylol | 1 year ago

Thank you for sharing the mitata tool! I was looking for something like that(for my monorepo).

I was wondering if there is a tool that can profile nodejs code? I did find some options(most of them are web tools) but they dont seem to give out information as much as mitata about what and where my code is used more often although mitata is a benchmarking tool.

What profilers do you use? Thanks :)

discuss

order

jitl|1 year ago

Start node with `node --inspect-brk …` or send SIGUSR1 to a running node process to expose the debug protocol port.

Then, connect with Chrome developer tools. You should see a NodeJS icon in the devtools if there’s a node process on your machine listening on the devtools port. You can use SSH port forwarding or similar to connect to processes on other machines like in a production environment.

Use the Chrome developer tools to take a profile, save it to disk, then analyze it using https://profiler.firefox.com

In production we use Datadog to collect and inspect profiles.

_andrei_|1 year ago

Clinic.js was promising but it's not maintained anymore, would be great if we had a modern alternative: https://clinicjs.org/