Skip to content

impl: support for displaying network latency #108

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

Merged
merged 11 commits into from
May 15, 2025

Conversation

fioan89
Copy link
Collaborator

@fioan89 fioan89 commented May 7, 2025

Under the "Additional environment information". Unfortunately it was not possible any other way. The description property is modifiable however Toolbox renders the description label only as long as the SSH connection is not established. As soon as an ssh connection is running the description label is used as mechanism to notify users about available IDE updates.

It also appears that we can't have any other extra tab, other than "Tools", "Projects" and "Settings". There is a secondary information attribute API, but it is not usable to show recurring metrics info because it can only be
configured once, it is not a mutable field.

The best effort was to add the information in the Settings page, and it is worth highlighting that the metrics are only refreshed when user either:

  • switches between tabs
  • expands/collapses the "Additional environment information" section.

There is no programmatic mechanism to notify the information in the Settings page that latency changed.

The network metrics are loaded from the pid files created by the ssh command. Toolbox spawns a native process running the SSH client. The ssh client then spawns another process which is associated to the coder proxy command. SSH network metrics are saved into json files with the name equal to the pid of the ssh command (not to be confused with the proxy command's name).

fioan89 added 10 commits May 7, 2025 23:03
Adds support for a configurable path where ssh network info stats
are going to be saved.
Remnant from the ssh background connection support
This patch provides UI support for the network inf dir where
ssh metrics will be saved. Users can configure the default
location for this place.
Also, the default directory is renamed to ssh-network-metrics
for a better description.
Toolbox spawns a native process running the SSH client. The ssh client then spawns
another process which associated to the coder proxy command. SSH network metrics
are saved into json file with the name equal to the pid of the ssh command (not
to be confused with the proxy command's name)
When ssh is connected a poll job is created that searches for the
SSH command pid, and then determines the network metrics json file.

The pid can change multiple times in a Toolbox session, especially
when the OS goes to sleep and comes back - the ssh is respawned.
This is the reason we don't cache the pid, instead always search
for it.

The poll job activates every 5 settings and it is cancelled when
the user stops the ssh connection.
This commit contains the data class necessary to
unmarshall the ssh network metrics and also the
necessary moshi plumbing for converting the json file.
Under the "Additional environment information". Unfortunately it was not
possible any other way. The description property is modifiable however
Toolbox renders the description label only as long as the SSH connection
is not established. As soon as an ssh connection is running the description
label is used as mechanism to notify users about available IDE updates.

It also appears that we can't have any other extra tab, other than "Tools",
"Projects" and "Settings". There is a secondary information attribute API,
but it is not usable to show recurring metrics info because it can only be
configured once, it is not a mutable field.

The best effort was to add the information in the Settings page, and it is
worth highlighting that the metrics are only refreshed when user either:
- switches between tabs
- expands/collapses teh "Additional environment information" section.

There is no programmatic mechanism to notify the information in the Settings
page changed
Discarded the download/upload stats, changed the text status, and I've
added support for Coder Connect.
UTs covering the status generation were also added.
@fioan89 fioan89 marked this pull request as ready for review May 14, 2025 20:41
@fioan89 fioan89 requested review from matifali and f0ssel May 14, 2025 20:41
@fioan89
Copy link
Collaborator Author

fioan89 commented May 14, 2025

Some screens with how it all looks like.
Screenshot 2025-05-14 at 23 01 58

Screenshot 2025-05-14 at 23 13 25

Screenshot 2025-05-14 at 23 15 26

@fioan89
Copy link
Collaborator Author

fioan89 commented May 14, 2025

@fioan89 fioan89 merged commit d5b1c3b into main May 15, 2025
5 checks passed
@fioan89 fioan89 deleted the support-for-displaying-network-latency branch May 15, 2025 18:13
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.

Report when Workspace is connected with SSH via Coder Connect Support for SSH connection metrics
2 participants