node-clinic icon indicating copy to clipboard operation
node-clinic copied to clipboard

Use `process.getActiveResourcesInfo()` instead of `process._activeHandles()`

Open RafaelGSS opened this issue 3 years ago • 4 comments

https://github.com/nodejs/node/pull/41587

RafaelGSS avatar Apr 04 '22 15:04 RafaelGSS

Looking at the uses of process._activeHandles() in this repo:

  • https://github.com/clinicjs/node-clinic-doctor/blob/efd85ff33c3006c025901fb94d7c6db0f7061f05/collect/process-stat.js#L52
  • https://github.com/clinicjs/node-clinic-doctor/blob/efd85ff33c3006c025901fb94d7c6db0f7061f05/test/collect-process-stat.test.js#L37

it looks like the use case here is to track the number of active handles. Is that a hard requirement or will it also be okay if this tracks the number of active resources (handles + requests + timers) instead?

I'm asking because process.getActiveResourcesInfo() currently reports the names of all the active resources. Extracting the number of active handles would require users to count each handle type by name.

RaisinTen avatar Dec 31 '22 05:12 RaisinTen

I wouldn't say hard requirement, but we do have this info in the clinic doctor report, if we change it suddenly, the users will be quite confused.

RafaelGSS avatar Dec 31 '22 13:12 RafaelGSS

Okay, in that case, maybe a semver-major release with this change would be an acceptable solution?

RaisinTen avatar Dec 31 '22 13:12 RaisinTen

Pretty much

RafaelGSS avatar Dec 31 '22 13:12 RafaelGSS