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
perf_hooks: allow omitted parameters in 'performance.measure' #32651
Conversation
I have no idea how to add a test for these additions, any suggestions? |
This probably needs a
changes:entry for the documentation and tests.I have no idea how to add a test for these additions, any suggestions?
Not really, because it isn’t quite obvious to me what exactly these changes end up doing.
// test.js
const { PerformanceObserver, performance } = require('perf_hooks');
const obs = new PerformanceObserver((items) => {
console.log(items.getEntries()[0].duration);
performance.clearMarks();
});
obs.observe({ entryTypes: ['measure'] });
setTimeout(() => {
performance.measure('Foo');
performance.mark('B')
performance.measure('to B', 'nodeStart', 'B');
}, 1000);./Release/node.exe test.js
1029.4472
1033.832401 |
|
@Himself65 I guess that example could serve as the basis for a test then? |
bf42542
to
b420270
Compare
0b38140
to
f85faa4
Compare
e9ec51a
to
25bd57d
Compare
Make `startMark` and `endMark` parameters optional.
Make `startMark` and `endMark` parameters optional. PR-URL: nodejs#32651 Fixes: nodejs#32647 Refs: https://www.w3.org/TR/user-timing-2/#measure-method Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
|
Landed in d0a3bf1 |
Make `startMark` and `endMark` parameters optional. PR-URL: #32651 Fixes: #32647 Refs: https://www.w3.org/TR/user-timing-2/#measure-method Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make `startMark` and `endMark` parameters optional. PR-URL: #32651 Fixes: #32647 Refs: https://www.w3.org/TR/user-timing-2/#measure-method Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Make `startMark` and `endMark` parameters optional. PR-URL: #32651 Fixes: #32647 Refs: https://www.w3.org/TR/user-timing-2/#measure-method Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Chengzhong Wu <legendecas@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>

FIxes: #32647
Refs: https://www.w3.org/TR/user-timing-2/#measure-method
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passes