clinicjs / node-clinic

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

Empty report generated for nodejs process #419

Open bradzacher opened 1 year ago

bradzacher commented 1 year ago

I was interested in using the clinic tooling in order to profile our ESLint tooling to help figure out where some hotspots were. Most of the tools worked, but clinic doctor returns an empty profile.

Repro: 1) clone https://github.com/typescript-eslint/typescript-eslint 2) clinic doctor -- node ./node_modules/.bin/eslint "**/*.ts" 3) observe console logs Profile data collected seems to be empty, report may not be generated 4) the html report is empty

Am I doing something wrong? Is there some way that I can use the tooling for this usecase or is it just not supported?

RafaelGSS commented 1 year ago

Hi @bradzacher

I'm trying to reproduce it locally, but the process hangs and does not exit successfully. It might be because of lint error?

rafaelgss@rafaelgss-desktop:~/repos/os/tests/typescript-eslint$ clinic doctor -- node ./node_modules/.bin/eslint "**/*.ts"
To generate the report press: Ctrl + C

/home/rafaelgss/repos/os/tests/typescript-eslint/packages/typescript-estree/tests/lib/parse.test.ts
  400:21  error  Expect must have a corresponding matcher call  jest/valid-expect

✖ 1 problem (1 error, 0 warnings)

Error: process exited by signal SIGABRT
    at ChildProcess.<anonymous> (/home/rafaelgss/.nvm/versions/node/v19.3.0/lib/node_modules/clinic/node_modules/@clinic/doctor/index.js:133:13)
    at Object.onceWrapper (node:events:628:26)
    at ChildProcess.emit (node:events:513:28)
    at ChildProcess._handle.onexit (node:internal/child_process:293:12)
bradzacher commented 1 year ago

weird - it exits just fine for me.

Adding to the repro: 1) clone 2) yarn 3) clinic doctor -- node ./node_modules/.bin/eslint "**/*.ts"

This is the result clinic returns to me: Archive.zip