-
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
worker: allow retrieving elu from parent #45330
Conversation
bcd43e5
to
09de2e5
Compare
09de2e5
to
c47419e
Compare
Usually, when extracting the ELU from a specific JS thread is better to do it from a different thread as the event loop we're observing might already be blocked. The `Worker.performance.eventLoopUtilization()` method allows us to do this for worker threads, but there's not a way to do this for the main thread. This new API, which allows us to retrieve the ELU of the parent thread from a specific worker, is going to enable this. For the moment, I have defined this new API in ``` require('worker_threads').parent.performance.eventLoopUtilization() ``` though I haven't added documentation yet as a) I want to know first whether this approach is acceptable, and in case it is, b) I'm not really sure whether that's the place the API should live in. Would love receiving feedback on this.
c47419e
to
d911989
Compare
This would need a rebase to fix the git conflicts.
Do we expect to expose more property related to the |
This issue/PR was marked as stalled, it will be automatically closed in 30 days. If it should remain open, please leave a comment explaining why it should remain open. |
Closing this because it has stalled. Feel free to reopen if this issue/PR is still relevant, or to ping the collaborator who labelled it stalled if you have any questions. |
Usually, when extracting the ELU from a specific JS thread is better to do it from a different thread as the event loop we're observing might already be blocked. The
Worker.performance.eventLoopUtilization()
method allows us to do this for worker threads, but there's not a way to do this for the main thread. This new API, which allows us to retrieve the ELU of the parent thread from a specific worker, is going to enable this.For the moment, I have defined this new API in
though I haven't added documentation yet as
a) I want to know first whether this approach is acceptable, and in case it is,
b) I'm not really sure whether that's the place the API should live in. Would love receiving feedback on this.