worker: allow retrieving elu from parent#45330
Closed
santigimeno wants to merge 1 commit intonodejs:mainfrom
Closed
worker: allow retrieving elu from parent#45330santigimeno wants to merge 1 commit intonodejs:mainfrom
santigimeno wants to merge 1 commit intonodejs:mainfrom
Conversation
bcd43e5 to
09de2e5
Compare
aduh95
reviewed
Nov 6, 2022
09de2e5 to
c47419e
Compare
aduh95
approved these changes
Nov 6, 2022
JungMinu
approved these changes
Nov 7, 2022
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
Collaborator
This was referenced Nov 11, 2022
This was referenced Nov 13, 2022
jasnell
approved these changes
Nov 16, 2022
Member
Author
Contributor
|
This would need a rebase to fix the git conflicts.
Do we expect to expose more property related to the |
Contributor
|
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. |
Contributor
|
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. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.