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

perf_hooks,http2: add clearEntries to remove http2 entries #18046

Closed
wants to merge 2 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Jan 8, 2018

Add missing clearHttp2 method to perf_hooks.performance to
remove the http2 entries from the master timeline to prevent
that from being a memory leak.

Checklist
  • make -j4 test (UNIX), or vcbuild test (Windows) passes
  • tests and/or benchmarks are included
  • documentation is changed or added
  • commit message follows commit guidelines
Affected core subsystem(s)

http2, perf_hooks

@jasnell jasnell added http2 Issues or PRs related to the http2 subsystem. perf_hooks Issues and PRs related to the implementation of the Performance Timing API. labels Jan 8, 2018
Add missing clearHttp2 method to `perf_hooks.performance` to
remove the http2 entries from the master timeline to prevent
that from being a memory leak.
@jasnell
Copy link
Member Author

jasnell commented Jan 9, 2018

ping @nodejs/http2

@@ -471,6 +471,10 @@ class Performance extends PerformanceObserverEntryList {
this[kClearEntry]('function', name);
}

clearHttp2() {
this[kClearEntry]('http2');
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not think this path is viable, as we will add clearNet(), clearHttp(), clearHTTPS() and so on. How about clear(string)?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1.


process.on('exit', () => {
// There shouldn't be any http2 entries left over.
assert.strictEqual(performance.getEntries().length, 1);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is the one entry that is left in there? Can we match that instead?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The nodeTiming entry and yes.

@jasnell jasnell mentioned this pull request Jan 10, 2018
4 tasks
@jasnell jasnell changed the title perf_hooks,http2: add clearHttp2 to remove http2 entries perf_hooks,http2: add clearEntries to remove http2 entries Jan 10, 2018
@jasnell
Copy link
Member Author

jasnell commented Jan 10, 2018

@mcollina ... updated

@@ -471,6 +471,10 @@ class Performance extends PerformanceObserverEntryList {
this[kClearEntry]('function', name);
}

clearEntries(name) {
this[kClearEntry](name);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we still need the Symbol now that this is exposed? Should we perform any validation?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The symbol form takes the additional name argument, which is not strictly necessary here, so I'd rather keep that. Validation is unnecessary since it would just be a non-op if some other value is passed.

Copy link
Member

@mcollina mcollina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@jasnell
Copy link
Member Author

jasnell commented Jan 10, 2018

jasnell added a commit that referenced this pull request Jan 11, 2018
Add missing clear() method to `perf_hooks.performance` to
remove the entries from the master timeline to prevent
that from being a memory leak.

PR-URL: #18046
Reviewed-By: Matteo Collina <[email protected]>
@jasnell
Copy link
Member Author

jasnell commented Jan 11, 2018

Landed in 20fe04f

@jasnell jasnell closed this Jan 11, 2018
@evanlucas evanlucas added the semver-minor PRs that contain new features and should be released in the next minor version. label Jan 30, 2018
evanlucas pushed a commit that referenced this pull request Jan 30, 2018
Add missing clear() method to `perf_hooks.performance` to
remove the entries from the master timeline to prevent
that from being a memory leak.

PR-URL: #18046
Reviewed-By: Matteo Collina <[email protected]>
evanlucas added a commit that referenced this pull request Jan 30, 2018
Notable changes:

* cluster
  - add cwd to cluster.settings (cjihrig) [#18399](#18399)
* deps
  - upgrade libuv to 1.19.1 (cjihrig) [#18260](#18260)
* meta
  - add Leko to collaborators (Leko) [#18117](#18117)
  - add vdeturckheim as collaborator (vdeturckheim) [#18432](#18432)
* n-api
  - expose n-api version in process.versions (Michael Dawson) [#18067](#18067)
* perf_hooks
  - add performance.clear() (James M Snell) [#18046](#18046)
* stream
  - avoid writeAfterEnd() while ending (陈刚) [#18170](#18170)

PR-URL: #18464
evanlucas added a commit that referenced this pull request Jan 31, 2018
Notable changes:

* cluster
  - add cwd to cluster.settings (cjihrig) [#18399](#18399)
* deps
  - upgrade libuv to 1.19.1 (cjihrig) [#18260](#18260)
* meta
  - add Leko to collaborators (Leko) [#18117](#18117)
  - add vdeturckheim as collaborator (vdeturckheim) [#18432](#18432)
* n-api
  - expose n-api version in process.versions (Michael Dawson) [#18067](#18067)
* perf_hooks
  - add performance.clear() (James M Snell) [#18046](#18046)
* stream
  - avoid writeAfterEnd() while ending (陈刚) [#18170](#18170)

PR-URL: #18464
evanlucas added a commit that referenced this pull request Feb 1, 2018
Notable changes:

* cluster
  - add cwd to cluster.settings (cjihrig) [#18399](#18399)
* deps
  - upgrade libuv to 1.19.1 (cjihrig) [#18260](#18260)
* meta
  - add Leko to collaborators (Leko) [#18117](#18117)
  - add vdeturckheim as collaborator (vdeturckheim) [#18432](#18432)
* n-api
  - expose n-api version in process.versions (Michael Dawson) [#18067](#18067)
* perf_hooks
  - add performance.clear() (James M Snell) [#18046](#18046)
* stream
  - avoid writeAfterEnd() while ending (陈刚) [#18170](#18170)

PR-URL: #18464
kjin pushed a commit to kjin/node that referenced this pull request May 1, 2018
Add missing clear() method to `perf_hooks.performance` to
remove the entries from the master timeline to prevent
that from being a memory leak.

PR-URL: nodejs#18046
Reviewed-By: Matteo Collina <[email protected]>
MylesBorins pushed a commit that referenced this pull request May 2, 2018
Add missing clear() method to `perf_hooks.performance` to
remove the entries from the master timeline to prevent
that from being a memory leak.

Backport-PR-URL: #20456
PR-URL: #18046
Reviewed-By: Matteo Collina <[email protected]>
@MylesBorins MylesBorins mentioned this pull request May 2, 2018
MayaLekova pushed a commit to MayaLekova/node that referenced this pull request May 8, 2018
Notable changes:

* cluster
  - add cwd to cluster.settings (cjihrig) [nodejs#18399](nodejs#18399)
* deps
  - upgrade libuv to 1.19.1 (cjihrig) [nodejs#18260](nodejs#18260)
* meta
  - add Leko to collaborators (Leko) [nodejs#18117](nodejs#18117)
  - add vdeturckheim as collaborator (vdeturckheim) [nodejs#18432](nodejs#18432)
* n-api
  - expose n-api version in process.versions (Michael Dawson) [nodejs#18067](nodejs#18067)
* perf_hooks
  - add performance.clear() (James M Snell) [nodejs#18046](nodejs#18046)
* stream
  - avoid writeAfterEnd() while ending (陈刚) [nodejs#18170](nodejs#18170)

PR-URL: nodejs#18464
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
http2 Issues or PRs related to the http2 subsystem. perf_hooks Issues and PRs related to the implementation of the Performance Timing API. 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.

3 participants