-
Notifications
You must be signed in to change notification settings - Fork 28
(PCP-410) Expose the connection timings #185
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
Conversation
2daebe4 to
f51796d
Compare
lib/src/connector/connector.cc
Outdated
| ConnectionTimings Connector::getConnectionTimings() const | ||
| { | ||
| return (connection_ptr_ == nullptr | ||
| ? ConnectionTimings() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I wonder where this ConnectionTimings() object is created - on the stack or heap?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Temporary storage depends on context, if I'm correct. More here: http://www.learncpp.com/cpp-tutorial/79-the-stack-and-the-heap/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It'll be stack, and copy elided to the caller.
|
LGTM |
| class LIBCPP_PCP_CLIENT_EXPORT Connection { | ||
| public: | ||
| /// To keep track of WebSocket timings | ||
| ConnectionTimings timings; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why did you make this public?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since the new AssociationTimings will be stored in the Connector, it makes more sense to me to allow Connector accessing directly the ConnectionTimings instead of having a copy from a Connection getter call. This is done considering that the actual user interface is provided by Connector, that does not expose the Connection instance.
No strong opinion here, I'm happy to make it private again if you think it's the case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems ok.
|
LGTM |
Adding reset method to ConnectionTimings. Making public the ConnectionTimings member (timings) of Connection. Adding ConnectionTimings getters to Connector. Adding new unit tests.
No description provided.