-
-
Notifications
You must be signed in to change notification settings - Fork 35.1k
Closed
Labels
questionIssues that look for answers.Issues that look for answers.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.
Description
It would be useful for some work I'm doing to be able to inspect cpu and memory usage for a vm script execution. A common use case may be using vm for micro-benchmarking code and spot leaks during testing.
An example could be:
const script = vm.runInNewContext('count += 1; name = "kitty"', sandbox);
script.memoryUsage(); // => similar to process.memoryUsage()
script.cpuUsage(); // => similar to process.cpuUsage()My questions are:
- Is it possible?
- If yes, how would be the best way? Could it be an extension to the current vm's node api (as suggested by the example)?
- If yes, a PR would be considered?
- If yes, would I be able to help with that? I am not familiar with the node code (especially the v8 part) but if we would agree about having this feature and its feasibility, I think I would be happy to help if needed, perhaps with some mentoring and/or guidance.
Thanks.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionIssues that look for answers.Issues that look for answers.vmIssues and PRs related to the vm subsystem.Issues and PRs related to the vm subsystem.