Processing Nodejs cpu profiles

I need to debug a 100% process using my nodejs process. I found it to be node --prof myapp.jsvery helpful. Now I have another application that will handle the child process, and I need to debug this child process. This is how I started the process.

require('child_process').fork("childfile.js", ["arg1","arg2], {silent: true});

Now my question is whether it is possible to profile the child process, while I can pass the -prof option.

+4
source share
1 answer
require('child_process').fork("childfile.js", ["arg1","arg2], {silent: true,execArgv:["--prof"]});
+1
source

Source: https://habr.com/ru/post/1680789/


All Articles