-
Notifications
You must be signed in to change notification settings - Fork 1
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
Conversation
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.
Also, I've raised the following issues with JetBrains in the hope we have more flexibility in the future to display full metrics similar to VS Code. https://youtrack.jetbrains.com/issue/TBX-14823/Support-mutable-and-styled-secondary-information-labels-in-JetBrains-Toolbox |
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:
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).