Skip to content
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

performance.nodeTiming doesn't work as documented #18992

Closed
TimothyGu opened this issue Feb 25, 2018 · 0 comments
Closed

performance.nodeTiming doesn't work as documented #18992

TimothyGu opened this issue Feb 25, 2018 · 0 comments
Assignees
Labels
perf_hooks Issues and PRs related to the implementation of the Performance Timing API.

Comments

@TimothyGu
Copy link
Member

  • Version: master
  • Platform: all
  • Subsystem: perf_hooks
'use strict';

const { performance } = require('perf_hooks');
console.log(performance.getEntries());

setTimeout(() => {
  console.log(performance.getEntries());
}, 1000);

prints

{ name: 'node',
  entryType: 'node',
  startTime: 134273200.382782,
  duration: 58.63538497686386,
  nodeStart: 134273200550404,
  v8Start: 134273201139625,
  bootstrapComplete: 0,
  environment: 134273205489261,
  loopStart: 0,
  loopExit: 0,
  thirdPartyMainStart: 0,
  thirdPartyMainEnd: 0,
  clusterSetupStart: 0,
  clusterSetupEnd: 0,
  moduleLoadStart: 134273255384838,
  moduleLoadEnd: 134273255401652,
  preloadModuleLoadStart: 134273255401823,
  preloadModuleLoadEnd: 134273255431580 }
{ name: 'node',
  entryType: 'node',
  startTime: 134273200.382782,
  duration: 1062.4414259791374,
  nodeStart: 134273200550404,
  v8Start: 134273201139625,
  bootstrapComplete: 134273262038325,
  environment: 134273205489261,
  loopStart: 134273262039729,
  loopExit: 0,
  thirdPartyMainStart: 0,
  thirdPartyMainEnd: 0,
  clusterSetupStart: 0,
  clusterSetupEnd: 0,
  moduleLoadStart: 134273255384838,
  moduleLoadEnd: 134273255401652,
  preloadModuleLoadStart: 134273255401823,
  preloadModuleLoadEnd: 134273255431580 }
  1. startTime should be 0-based. performance.now() suffers an identical problem (performance.now() returns incorrect value #17892)
  2. The Node.js-specific milestones have nanoseconds as units, while they should have milliseconds precision per docs.
  3. The 0 special value ("the milestone has not been reached") is not documented, and may conflict with valid values after issues 1 and 2 are fixed.
@TimothyGu TimothyGu added the perf_hooks Issues and PRs related to the implementation of the Performance Timing API. label Feb 25, 2018
@TimothyGu TimothyGu self-assigned this Feb 25, 2018
@TimothyGu TimothyGu mentioned this issue Feb 25, 2018
4 tasks
TimothyGu added a commit to TimothyGu/node that referenced this issue Mar 4, 2018
@jasnell jasnell closed this as completed in 9256dbb Mar 6, 2018
MylesBorins pushed a commit that referenced this issue Mar 6, 2018
Fixes: #17892
Fixes: #17893
Fixes: #18992

PR-URL: #18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this issue Mar 6, 2018
Fixes: #17892
Fixes: #17893
Fixes: #18992

PR-URL: #18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this issue Mar 6, 2018
Fixes: #17892
Fixes: #17893
Fixes: #18992

PR-URL: #18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this issue Mar 6, 2018
Fixes: #17892
Fixes: #17893
Fixes: #18992

PR-URL: #18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this issue Mar 7, 2018
Fixes: #17892
Fixes: #17893
Fixes: #18992

PR-URL: #18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MayaLekova pushed a commit to MayaLekova/node that referenced this issue May 8, 2018
Fixes: nodejs#17892
Fixes: nodejs#17893
Fixes: nodejs#18992

PR-URL: nodejs#18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
jasnell pushed a commit to jasnell/node that referenced this issue Aug 17, 2018
Fixes: nodejs#17892
Fixes: nodejs#17893
Fixes: nodejs#18992

PR-URL: nodejs#18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
MylesBorins pushed a commit that referenced this issue Sep 6, 2018
Fixes: #17892
Fixes: #17893
Fixes: #18992

Backport-PR-URL: #22380
PR-URL: #18993
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Anatoli Papirovski <apapirovski@mac.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
perf_hooks Issues and PRs related to the implementation of the Performance Timing API.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant