-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Add logging around heartbeats #3628
Conversation
lastHeartbeat time.Time | ||
heartbeatTTL time.Duration | ||
heartbeatLock sync.Mutex | ||
lastHeartbeat time.Time |
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.
Maybe have a heartbeat struct instead of all of these as direct fields on the client?
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.
Looks like valuable logging. Maybe think about creating a heartbeat struct, as all of these fields are related and could be grouped into a single object that the client owns (and potentially extract the heartbeat update logic into a function on that type)
|
||
// Update heartbeat time and ttl | ||
// Update the last heartbeat and the new TTL, capturing the old values | ||
c.heartbeatLock.Lock() |
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.
This could be extracted into a function on a heartbeat struct.
I'm going to lock this pull request because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active contributions. |
Add logging to determine how long it took between attempting to heartbeat
to servers and receiving a response and add to output how long the client was over the TTL it was given.
This is to help address #3595