-
Notifications
You must be signed in to change notification settings - Fork 29.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
process: expose uv_rusage on process.resourceUsage() #28018
Conversation
Looks like you didn't forget anything. Thanks for the pull request and welcome! |
dfdcae7
to
2eff3d1
Compare
Any reason this would make |
doc/api/process.md
Outdated
--> | ||
|
||
* Returns: {Object} | ||
* `minflt` {integer} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not sure if it matters at the JS level, but these are all unsigned integers.
315c0e1
to
3f0d72b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. My comments are not blockers.
3f0d72b
to
68947b7
Compare
I've switched to full names, added the mapping between node names and libuv ones. Also exposed all the fields even if not supported as @bnoordhuis said. |
What benefit do we have by exposing entries that are not supported on any platform? |
@BridgeAR Future-proofing and standards conformance would be the two big pro arguments, I imagine? |
d6374b6
to
7bed043
Compare
I believe the PR is good to be merged expect if someone has a blocker on the exposed fields ? |
b582b90
to
d9579de
Compare
I've rebased on master hoping that the test on worker-prof will pass now |
I've checked the test failures and it doesn't seems to be related to this PR, what are the next steps in this case ? |
d9579de
to
99f777f
Compare
As discussed in nodejs/diagnostics#161, the core should expose important metrics about the runtime, this PR's goal is to let user get the number of io request made, and lower level mertrics like the page faults and context switches.
99f777f
to
d770f66
Compare
@Trott I'm not sure what are the next steps, do you think the PR can be merged ? |
@vmarchaud Thanks for the ping! Landed in 6271ef0 🎉 |
As discussed in nodejs/diagnostics#161, the core should expose important metrics about the runtime, this PR's goal is to let user get the number of io request made, and lower level mertrics like the page faults and context switches. PR-URL: #28018 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
As discussed in nodejs/diagnostics#161, the core should expose important metrics about the runtime, this PR's goal is to let user get the number of io request made, and lower level mertrics like the page faults and context switches. PR-URL: #28018 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
As discussed in nodejs/diagnostics#161, the core should expose important metrics about the runtime, this PR's goal is to let user get the number of io request made, and lower level mertrics like the page faults and context switches. PR-URL: #28018 Reviewed-By: Ben Noordhuis <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Anna Henningsen <[email protected]>
Notable changes: * build: * Experimental support for building Node.js on MIPS architecture is back. #27992 * child_process: * The promisified versions of `child_process.exec` and `child_process.execFile` now both return a `Promise` which has the child instance attached to their `child` property. #28325 * deps: * Updated libuv to 1.30.0. #28449 * Support for the Haiku platform has been added. * The maximum `UV_THREADPOOL_SIZE` has been increased from 128 to 1024. * `uv_fs_copyfile()` now works properly when the source and destination files are the same. * process: * A new method, `process.resourceUsage()` was added. It returns resource usage for the current process, such as CPU time. #28018 * src: * Fixed an issue related to stdio that could lead to a crash of the process in some circumstances. #28490 * stream: * Added a `writableFinished` property to writable streams. It indicates that all the data has been flushed to the underlying system. #28007 * worker: * Fixed an issue that prevented worker threads to listen for data on stdin. #28153 PR-URL: #28508
Notable changes: * build: * Experimental support for building Node.js on MIPS architecture is back. #27992 * child_process: * The promisified versions of `child_process.exec` and `child_process.execFile` now both return a `Promise` which has the child instance attached to their `child` property. #28325 * deps: * Updated libuv to 1.30.0. #28449 * Support for the Haiku platform has been added. * The maximum `UV_THREADPOOL_SIZE` has been increased from 128 to 1024. * `uv_fs_copyfile()` now works properly when the source and destination files are the same. * process: * A new method, `process.resourceUsage()` was added. It returns resource usage for the current process, such as CPU time. #28018 * src: * Fixed an issue related to stdio that could lead to a crash of the process in some circumstances. #28490 * stream: * Added a `writableFinished` property to writable streams. It indicates that all the data has been flushed to the underlying system. #28007 * worker: * Fixed an issue that prevented worker threads to listen for data on stdin. #28153 * meta: * Added Jiawen Geng (https://github.com/gengjiawen) to collaborators. #28322 PR-URL: #28508
Notable changes: * build: * Experimental support for building Node.js on MIPS architecture is back. #27992 * child_process: * The promisified versions of `child_process.exec` and `child_process.execFile` now both return a `Promise` which has the child instance attached to their `child` property. #28325 * deps: * Updated libuv to 1.30.1. #28449, #28511 * Support for the Haiku platform has been added. * The maximum `UV_THREADPOOL_SIZE` has been increased from 128 to 1024. * `uv_fs_copyfile()` now works properly when the source and destination files are the same. * process: * A new method, `process.resourceUsage()` was added. It returns resource usage for the current process, such as CPU time. #28018 * src: * Fixed an issue related to stdio that could lead to a crash of the process in some circumstances. #28490 * stream: * Added a `writableFinished` property to writable streams. It indicates that all the data has been flushed to the underlying system. #28007 * worker: * Fixed an issue that prevented worker threads to listen for data on stdin. #28153 * meta: * Added Jiawen Geng (https://github.com/gengjiawen) to collaborators. #28322 PR-URL: #28508
Notable changes: * build: * Experimental support for building Node.js on MIPS architecture is back. #27992 * child_process: * The promisified versions of `child_process.exec` and `child_process.execFile` now both return a `Promise` which has the child instance attached to their `child` property. #28325 * deps: * Updated libuv to 1.30.1. #28449, #28511 * Support for the Haiku platform has been added. * The maximum `UV_THREADPOOL_SIZE` has been increased from 128 to 1024. * `uv_fs_copyfile()` now works properly when the source and destination files are the same. * process: * A new method, `process.resourceUsage()` was added. It returns resource usage for the current process, such as CPU time. #28018 * src: * Fixed an issue related to stdio that could lead to a crash of the process in some circumstances. #28490 * stream: * Added a `writableFinished` property to writable streams. It indicates that all the data has been flushed to the underlying system. #28007 * worker: * Fixed an issue that prevented worker threads to listen for data on stdin. #28153 * meta: * Added Jiawen Geng (https://github.com/gengjiawen) to collaborators. #28322 PR-URL: #28508
As discussed in nodejs/diagnostics#161,
the core should expose important metrics about the runtime, this PR's
goal is to let user get the number of io request made, and lower level
metrics like the page faults and context switches.
Themake -j4 test
are not passing locally because of a failing testtest/parallel/test-worker-prof.js
but i believe it's not related to my changes.Concerning the tests, i didn't really tested the output of the function mainly because it might make the test flaky depending on the platform and runtime behavior.
This is my first PR on the core, so i might have forgotten some requirements.
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passes