FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[v12.x backport] worker: add eventLoopUtilization() by juanarbol · Pull Request #37165 · nodejs/node · GitHub

/ node Public

[v12.x backport] worker: add eventLoopUtilization() - #37165

Merged
richardlau merged 2 commits into
nodejs:v12.x-stagingfrom
juanarbol:backport-35664-to-12.x
Mar 16, 2021
Merged

[v12.x backport] worker: add eventLoopUtilization()#37165
richardlau merged 2 commits into
nodejs:v12.x-stagingfrom
juanarbol:backport-35664-to-12.x

Conversation

juanarbol commented Feb 1, 2021
edited
Loading

Copy link
Copy Markdown
Member

Refs: #35664

Allow calling eventLoopUtilization() directly on a worker thread:

const worker = new Worker('./foo.js');
const elu = worker.performance.eventLoopUtilization();
setTimeout(() => {
  worker.performance.eventLoopUtilization(elu);
}, 10);

Add a new performance object on the Worker instance that will hopefully
one day hold all the other performance metrics, such as nodeTiming.

Include benchmarks and tests.

PR-URL: #35664
Reviewed-By: Juan José Arboleda soyjuanarbol@gmail.com
Reviewed-By: Anna Henningsen anna@addaleax.net
Reviewed-By: Gerhard Stöbich deb2001-github@yahoo.de
Reviewed-By: James M Snell jasnell@gmail.com

nodejs-github-bot added c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. v12.x labels Feb 1, 2021
juanarbol changed the title worker: add eventLoopUtilization() [12.x backport] worker: add eventLoopUtilization() Feb 1, 2021
juanarbol changed the title [12.x backport] worker: add eventLoopUtilization() [v12.x backport] worker: add eventLoopUtilization() Feb 1, 2021
juanarbol force-pushed the backport-35664-to-12.x branch from 5bbaeb0 to 542c56f Compare February 1, 2021 03:34

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

richardlau added the semver-minor PRs that contain new features and should be released in the next minor version. label Feb 1, 2021

Copy link
Copy Markdown
Member

Does this include #35891?

Copy link
Copy Markdown
Member Author

Does this include #35891?

Nope, let me work on that for both backport PRs

Copy link
Copy Markdown
Member Author

@richardlau should I squash #35891 with #35664 ? or basically follow the steps described in the backporting guide (here) for both commits ?

Copy link
Copy Markdown
Member Author

The node-test-commit-custom-suites-freestyle (test-worker) tests failed in both CIs, I'll take a closer look.

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member Author

@richardlau is there anything missing here?

This comment has been minimized.

Copy link
Copy Markdown
Member

@juanarbol Could you rebase this onto the current v12.x-staging please?

juanarbol force-pushed the backport-35664-to-12.x branch from e132479 to 77ef942 Compare March 2, 2021 20:23
juanarbol force-pushed the backport-35664-to-12.x branch from 77ef942 to 2e3251e Compare March 2, 2021 20:25

Copy link
Copy Markdown
Member Author

@richardlau Rebased!

This comment has been minimized.

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Collaborator

Copy link
Copy Markdown
Member

@juanarbol parallel/test-bootstrap-modules is failing with workers (python tools/test.py --worker parallel/test-bootstrap-modules). It looks like the test change from https://github.com/nodejs/node/pull/35664/files#diff-eeda4d549f43051fb9ffbc8286e838ebfd607bae681dfc55a76679e6705124f9 is missing here?

juanarbol force-pushed the backport-35664-to-12.x branch from 2e3251e to e663156 Compare March 8, 2021 20:38
juanarbol force-pushed the backport-35664-to-12.x branch from e663156 to 280d3c2 Compare March 8, 2021 21:14

Copy link
Copy Markdown
Collaborator

CI: https://ci.nodejs.org/job/node-test-pull-request/36554/

Copy link
Copy Markdown
Member Author

@richardlau, your review is addressed :) I think this is ready to be landed.

trevnorris and others added 2 commits March 16, 2021 00:04
Allow calling eventLoopUtilization() directly on a worker thread:

    const worker = new Worker('./foo.js');
    const elu = worker.performance.eventLoopUtilization();
    setTimeout(() => {
      worker.performance.eventLoopUtilization(elu);
    }, 10);

Add a new performance object on the Worker instance that will hopefully
one day hold all the other performance metrics, such as nodeTiming.

Include benchmarks and tests.

PR-URL: nodejs#35664
Reviewed-By: Juan José Arboleda <soyjuanarbol@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gerhard Stöbich <deb2001-github@yahoo.de>
Reviewed-By: James M Snell <jasnell@gmail.com>

Backport-PR-URL: nodejs#37165
The active worker check compared the time from sending message till
response arrived from worker with the complete time the worker was
running till it responses to the spin request.

If sending back the message is slow for some reason the test fails.

Adapt the test to compare the time seen inside the worker with the
time read from main thread.

PR-URL: nodejs#35891
Fixes: nodejs#35844
Refs: nodejs#35886
Refs: nodejs#35664
Reviewed-By: Gireesh Punathil <gpunathi@in.ibm.com>
Reviewed-By: Rich Trott <rtrott@gmail.com>

Backport-PR-URL: nodejs#37165
richardlau force-pushed the backport-35664-to-12.x branch from 280d3c2 to d7a4ccd Compare March 16, 2021 00:22

Copy link
Copy Markdown
Member

Landed in 0f6d445...d7a4ccd

richardlau merged commit d7a4ccd into nodejs:v12.x-staging Mar 16, 2021
juanarbol deleted the backport-35664-to-12.x branch August 26, 2021 17:54
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

Labels

c++ Issues and PRs that require attention from people who are familiar with C++. lib / src Issues and PRs related to general changes in the lib or src directory. semver-minor PRs that contain new features and should be released in the next minor version.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants


Back | FazBrowse Home | New Git URL