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

http2: add Http2Session.lastReceivedTime #23010

Closed
wants to merge 3 commits into from

Conversation

jasnell
Copy link
Member

@jasnell jasnell commented Sep 21, 2018

Adds a time stamp indicating the last time data was received from
the connected peer.

Fixes: #21730

/cc @murgatroid99 who requested the feature
/cc @nodejs/http2

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

@nodejs-github-bot 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. labels Sep 21, 2018
@jasnell jasnell added semver-minor PRs that contain new features and should be released in the next minor version. http2 Issues or PRs related to the http2 subsystem. labels Sep 21, 2018
@jasnell
Copy link
Member Author

jasnell commented Sep 21, 2018

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 jasnell added the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 21, 2018
@addaleax
Copy link
Member

Hm … given that this isn’t specific to HTTP/2 as a protocol, would it make sense to implement this for net.Sockets in general, and forward it on the HTTP/2 session?

@jasnell
Copy link
Member Author

jasnell commented Sep 22, 2018

Hm … given that this isn’t specific to HTTP/2 as a protocol, would it make sense to implement this for net.Sockets in general, and forward it on the HTTP/2 session?

maybe? lol ... perhaps this for now and if we receive any requests to generalize it we can fairly easily.

@BridgeAR
Copy link
Member

The addition itself seems like a good thing but I would prefer to have it as a function call named getLastReceivedTime(). It's already implemented as getter and making it a function reduces the chance that a user has a typo when using this.

I also like the suggestion from @addaleax to make it a general thing for net.Socket.

@jasnell
Copy link
Member Author

jasnell commented Sep 23, 2018

Making it a generalized thing for net.Socket can be done later in a separate PR if there is a demand for it.

@addaleax
Copy link
Member

Adds a time stamp indicating the last time data was received from
the connected peer.

Fixes: nodejs#21730
@jasnell
Copy link
Member Author

jasnell commented Sep 23, 2018

@mcollina and @ryzokuken ... changed to a function to address @BridgeAR's feedback. PTAL

@jasnell
Copy link
Member Author

jasnell commented Sep 23, 2018

@addaleax
Copy link
Member

Benchmark CI shows a few small but significant drops, here’s one with more iterations: https://ci.nodejs.org/view/Node.js%20benchmark/job/benchmark-node-micro-benchmarks/240/

@jasnell
Copy link
Member Author

jasnell commented Sep 24, 2018

Yeah, I was afraid of that on the perf drop. Before this lands I'll investigate how I can minimize that

@lundibundi
Copy link
Member

@jasnell should author ready be removed then to avoid confusion and someone landing this before you finish?

@jasnell
Copy link
Member Author

jasnell commented Sep 24, 2018 via email

@lundibundi lundibundi removed the author ready PRs that have at least one approval, no pending requests for changes, and a CI started. label Sep 24, 2018
Copy link
Contributor

@ryzokuken ryzokuken left a comment

Choose a reason for hiding this comment

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

LGTM after the update suggested by @BridgeAR

@jasnell jasnell added the wip Issues and PRs that are still a work in progress. label Oct 23, 2018
@jasnell
Copy link
Member Author

jasnell commented Jan 2, 2019

Going to close this and revisit it later.

@jasnell jasnell closed this Jan 2, 2019
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++. http2 Issues or PRs related to the http2 subsystem. 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. wip Issues and PRs that are still a work in progress.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants