- Notifications
You must be signed in to change notification settings - Fork1.1k
feat: Workspace Proxy picker show latency to each proxy#7486
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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Merged
Uh oh!
There was an error while loading.Please reload this page.
Merged
Changes fromall commits
Commits
Show all changes
23 commits Select commitHold shift + click to select a range
40ec420 WIP, this is a broken axios
Emyrkd639a76 Discard intercepters
Emyrk5f73d6b Performance wip
Emyrkbec803f chore: Add cors to workspace proxies to allow for latency checks
Emyrk4b7a40e WUIP
Emyrk3cae4b0 Add latency check to wsproxy
Emyrk45d0e4c wip
Emyrk32d0e41 Wip
Emyrkc2638ab chore: Fix FE for measuring latencies
Emyrk66399ae Switch to proxy latency report
Emyrkce7ad2b Fix cache bust busting our own cache
Emyrk5c1412f Share colors from the agent row
Emyrkaab9e71 Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_pi…
Emyrk583ad65 Fix yarn deps?
Emyrk77498b1 fmt
Emyrk2cdb2a9 Fmt
Emyrkbc1c10d Add performance mock
Emyrkbc38e40 nolint
Emyrk679e5fc Remove global mock
Emyrkb90eda0 Add mock latencies to tests/storybook
Emyrk3d8063e Github actions was down, forcing it to run
Emyrk56bf7b7 Merge remote-tracking branch 'origin/main' into stevenmasley/proxy_pi…
Emyrk16699b6 skip flakey test
EmyrkFile filter
Filter by extension
Conversations
Failed to load comments.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Jump to
Jump to file
Failed to load files.
Loading
Uh oh!
There was an error while loading.Please reload this page.
Diff view
Diff view
There are no files selected for viewing
11 changes: 11 additions & 0 deletionscoderd/coderd.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletionscoderd/coderd_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletionscoderd/latencycheck.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| package coderd | ||
| import ( | ||
| "net/http" | ||
| "net/url" | ||
| "strings" | ||
| ) | ||
| func LatencyCheck(allowedOrigins ...*url.URL) http.HandlerFunc { | ||
| allowed := make([]string, 0, len(allowedOrigins)) | ||
| for _, origin := range allowedOrigins { | ||
| // Allow the origin without a path | ||
| tmp := *origin | ||
| tmp.Path = "" | ||
| allowed = append(allowed, strings.TrimSuffix(origin.String(), "/")) | ||
| } | ||
| origins := strings.Join(allowed, ",") | ||
| return func(rw http.ResponseWriter, r *http.Request) { | ||
| // Allowing timing information to be shared. This allows the browser | ||
| // to exclude TLS handshake timing. | ||
| rw.Header().Set("Timing-Allow-Origin", origins) | ||
| rw.WriteHeader(http.StatusOK) | ||
| } | ||
| } |
1 change: 1 addition & 0 deletionsenterprise/coderd/workspaceproxy_test.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
38 changes: 24 additions & 14 deletionsenterprise/wsproxy/wsproxy.go
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
24 changes: 24 additions & 0 deletionssite/jest.setup.ts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
1 change: 1 addition & 0 deletionssite/package.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionssite/src/components/AppLink/AppLink.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
13 changes: 3 additions & 10 deletionssite/src/components/Resources/AgentLatency.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionssite/src/components/Resources/AgentRow.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
8 changes: 7 additions & 1 deletionsite/src/components/Resources/ResourceCard.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
2 changes: 2 additions & 0 deletionssite/src/components/Workspace/Workspace.stories.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
7 changes: 7 additions & 0 deletionssite/src/contexts/ProxyContext.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.Learn more about bidirectional Unicode characters
Oops, something went wrong.
Uh oh!
There was an error while loading.Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.