Skip to content

chore: added latency tooltips on workspaces #134

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

ibetitsmike
Copy link
Contributor

Fixes: #106

}
}
if (LastHandshake != null)
description.Append($"\n\nLast handshake: {LastHandshake?.ToString() ?? "Unknown"}");
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
description.Append($"\n\nLast handshake: {LastHandshake?.ToString() ?? "Unknown"}");
description.Append($"\n\nLast handshake: {LastHandshake.ToString()}");


// For compatibility with older deployments, we assume that if the
// last ping is null, the agent is healthy.
var isLatencyAcceptable = agent.LastPing != null ? agent.LastPing.Latency.ToTimeSpan() < HealthyPingThreshold : true;
Copy link
Member

Choose a reason for hiding this comment

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

Did you check that the behavior of the C# protobuf library does this? They usually just use a zero value when it's not set to be consistent with other protobuf implementations

Comment on lines +255 to +256
if (string.IsNullOrEmpty(tooltip))
return "No connection information available.";
Copy link
Member

Choose a reason for hiding this comment

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

Could this just be an else on the if (p2p) {} else if (derp) {} at the top?

Comment on lines +221 to +230
You're connected peer-to-peer.
You ↔ {Latency.Value.Milliseconds} ms ↔ {WorkspaceName}
"""
);
}
else if (PreferredDerpLatency != null)
{
description.Append($"""
You're connected through a DERP relay.
Copy link
Member

@ethanndickson ethanndickson Jun 24, 2025

Choose a reason for hiding this comment

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

On Mac, we include a (High latency) after both first sentences if the ping is unacceptable, otherwise the status icon turns yellow with no indication as to why.

You're connected through a DERP relay.
We'll switch over to peer-to-peer when available.
Total latency: {PreferredDerpLatency.Value.Milliseconds} ms
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this be the total latency, not just the preferred derp latency?

"""
);

if (PreferredDerp != null && Latency != null)
Copy link
Member

@ethanndickson ethanndickson Jun 24, 2025

Choose a reason for hiding this comment

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

Shouldn't this second null check be against PreferredDerpLatency?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Show latency on workspace view
3 participants