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

Add logging around heartbeats #3628

Merged
merged 2 commits into from
Dec 7, 2017
Merged

Add logging around heartbeats #3628

merged 2 commits into from
Dec 7, 2017

Conversation

dadgar
Copy link
Contributor

@dadgar dadgar commented Dec 7, 2017

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

lastHeartbeat time.Time
heartbeatTTL time.Duration
heartbeatLock sync.Mutex
lastHeartbeat time.Time
Copy link
Contributor

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?

Copy link
Contributor

@chelseakomlo chelseakomlo left a 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()
Copy link
Contributor

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.

@dadgar dadgar merged commit 7c7eb2e into master Dec 7, 2017
@dadgar dadgar deleted the b-heartbeat branch December 7, 2017 18:12
@github-actions
Copy link

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.
If you have found a problem that seems related to this change, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants