Skip to content

Conversation

@juanarbol
Copy link
Member

@juanarboljuanarbol commented Feb 1, 2021

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 [email protected]
Reviewed-By: Anna Henningsen [email protected]
Reviewed-By: Gerhard Stöbich [email protected]
Reviewed-By: James M Snell [email protected]

@nodejs-github-botnodejs-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
@juanarboljuanarbol changed the title worker: add eventLoopUtilization()[12.x backport] worker: add eventLoopUtilization()Feb 1, 2021
@juanarboljuanarbol changed the title [12.x backport] worker: add eventLoopUtilization()[v12.x backport] worker: add eventLoopUtilization()Feb 1, 2021
juanarbol pushed a commit to juanarbol/node that referenced this pull request Feb 1, 2021
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> Backport-PR-URL: nodejs#37165
@juanarboljuanarbolforce-pushed the backport-35664-to-12.x branch from 5bbaeb0 to 542c56fCompareFebruary 1, 2021 03:34
@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

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

Does this include #35891?

@juanarbol
Copy link
MemberAuthor

Does this include #35891?

Nope, let me work on that for both backport PRs

@juanarbol
Copy link
MemberAuthor

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

@juanarbol
Copy link
MemberAuthor

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

juanarbol pushed a commit to juanarbol/node that referenced this pull request Feb 1, 2021
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#35891Fixes: nodejs#35844 Refs: nodejs#35886 Refs: nodejs#35664 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#37165
@nodejs-github-bot
Copy link
Collaborator

juanarbol pushed a commit to juanarbol/node that referenced this pull request Feb 10, 2021
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> Backport-PR-URL: nodejs#37165
@juanarboljuanarbolforce-pushed the backport-35664-to-12.x branch from 344f7ff to e132479CompareFebruary 10, 2021 21:49
juanarbol pushed a commit to juanarbol/node that referenced this pull request Feb 10, 2021
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#35891Fixes: nodejs#35844 Refs: nodejs#35886 Refs: nodejs#35664 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#37165
@juanarbol
Copy link
MemberAuthor

@richardlau is there anything missing here?

@nodejs-github-bot

This comment has been minimized.

@richardlau
Copy link
Member

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

juanarbol pushed a commit to juanarbol/node that referenced this pull request Mar 2, 2021
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> Backport-PR-URL: nodejs#37165
@juanarboljuanarbolforce-pushed the backport-35664-to-12.x branch from e132479 to 77ef942CompareMarch 2, 2021 20:23
juanarbol pushed a commit to juanarbol/node that referenced this pull request Mar 2, 2021
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#35891Fixes: nodejs#35844 Refs: nodejs#35886 Refs: nodejs#35664 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#37165
juanarbol pushed a commit to juanarbol/node that referenced this pull request Mar 2, 2021
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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> Backport-PR-URL: nodejs#37165
juanarbol pushed a commit to juanarbol/node that referenced this pull request Mar 2, 2021
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#35891Fixes: nodejs#35844 Refs: nodejs#35886 Refs: nodejs#35664 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#37165
@juanarboljuanarbolforce-pushed the backport-35664-to-12.x branch from 77ef942 to 2e3251eCompareMarch 2, 2021 20:25
@juanarbol
Copy link
MemberAuthor

@richardlau Rebased!

@nodejs-github-bot

This comment has been minimized.

@nodejs-github-bot
Copy link
Collaborator

@nodejs-github-bot
Copy link
Collaborator

@richardlau
Copy link
Member

@juanarbolparallel/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 pushed a commit to juanarbol/node that referenced this pull request Mar 8, 2021
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#35891Fixes: nodejs#35844 Refs: nodejs#35886 Refs: nodejs#35664 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#37165
@juanarboljuanarbolforce-pushed the backport-35664-to-12.x branch from 2e3251e to e663156CompareMarch 8, 2021 20:38
juanarbol pushed a commit to juanarbol/node that referenced this pull request Mar 8, 2021
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#35891Fixes: nodejs#35844 Refs: nodejs#35886 Refs: nodejs#35664 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#37165
@juanarboljuanarbolforce-pushed the backport-35664-to-12.x branch from e663156 to 280d3c2CompareMarch 8, 2021 21:14
@nodejs-github-bot
Copy link
Collaborator

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

@juanarbol
Copy link
MemberAuthor

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

trevnorrisand 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 <[email protected]> Reviewed-By: Anna Henningsen <[email protected]> Reviewed-By: Gerhard Stöbich <[email protected]> Reviewed-By: James M Snell <[email protected]> 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#35891Fixes: nodejs#35844 Refs: nodejs#35886 Refs: nodejs#35664 Reviewed-By: Gireesh Punathil <[email protected]> Reviewed-By: Rich Trott <[email protected]> Backport-PR-URL: nodejs#37165
@richardlaurichardlauforce-pushed the backport-35664-to-12.x branch from 280d3c2 to d7a4ccdCompareMarch 16, 2021 00:22
@richardlau
Copy link
Member

Landed in 0f6d445...d7a4ccd

@richardlaurichardlau merged commit d7a4ccd into nodejs:v12.x-stagingMar 16, 2021
@juanarboljuanarbol deleted the backport-35664-to-12.x branch August 26, 2021 17:54
Sign up for freeto 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 / srcIssues and PRs related to general changes in the lib or src directory.semver-minorPRs 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

@juanarbol@nodejs-github-bot@richardlau@jasnell@trevnorris@Flarna