Skip to content

chore: added latency tooltips on workspaces#134

Merged
ibetitsmike merged 5 commits into
mainfrom
mike/106-latency-on-workspaces
Jun 26, 2025
Merged

chore: added latency tooltips on workspaces#134
ibetitsmike merged 5 commits into
mainfrom
mike/106-latency-on-workspaces

Conversation

@ibetitsmike

@ibetitsmike ibetitsmike commented Jun 23, 2025

Copy link
Copy Markdown
Contributor

Fixes: #106

image
image

Comment thread App/ViewModels/AgentViewModel.cs Outdated
Comment thread App/ViewModels/TrayWindowViewModel.cs Outdated

// 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
Copy Markdown
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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yes, for reference types it will be null.

Comment thread App/ViewModels/AgentViewModel.cs Outdated
Comment thread App/ViewModels/AgentViewModel.cs Outdated
Comment thread App/ViewModels/AgentViewModel.cs Outdated
Comment thread App/ViewModels/AgentViewModel.cs Outdated
Comment thread App/ViewModels/AgentViewModel.cs Outdated
Comment thread App/ViewModels/AgentViewModel.cs Outdated
: AgentConnectionStatus.Yellow;
var connectionStatus = AgentConnectionStatus.Healthy;

if (agent.LastHandshake != null && agent.LastHandshake.ToDateTime() != default && agent.LastHandshake.ToDateTime() < DateTime.UtcNow)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

👍

description.Append(ConnectionStatus.ToDisplayString());
}
if (LastHandshake != null)
description.Append($"\n\nLast handshake: {LastHandshake?.ToString()}");

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I have a relative timestamp (i.e. 5 seconds ago) here but I actually gotta get rid of it, so this is fine.
( Have to get rid of it cause it only gets rendered once, and doesn't update on tooltip re-hovers 😦 )

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Yeah, I check for Default and set to null in the viewmodel cause showing a made up handshake just felt wrong.

@ibetitsmike ibetitsmike merged commit b8d7993 into main Jun 26, 2025
3 checks passed
@ibetitsmike ibetitsmike deleted the mike/106-latency-on-workspaces branch June 26, 2025 09:07
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