clinicjs / node-clinic

Clinic.js diagnoses your Node.js performance issues
https://clinicjs.org
MIT License
5.69k stars 125 forks source link

heapprofiler: wrong PID in the resulting file name #452

Closed alexandervain closed 1 year ago

alexandervain commented 1 year ago

Expected Behavior

The resulting file (.clinic/555.clinic-heapprofiler) of the clinic heapprofiler -- node foo.js command would contain the PID (555) of the "foo.js" process.

Current Behavior

The file name contain the PID of the parent clinic process itself.

This behaviour is different from all other clinic modes (flame, doctor, bubbleprof) where the used PID is the one of the child process.

Steps to Reproduce (for bugs)

  1. run clinic heapprofiler --collect-only -- node app.js
  2. inspect the PIDs of the clinic process and the child "app" process
  3. stop the clinic heapprofiler (CTRL-C)
  4. Check the name of the generated result file

Environment

RafaelGSS commented 1 year ago

Would you like to send a Pull Request to address this issue? Remember to add unit tests.