Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 6679ae3

Browse files
committed
Add avatar url into user latency insihgts
1 parent b40bdae commit 6679ae3

File tree

10 files changed

+33
-5
lines changed

10 files changed

+33
-5
lines changed

coderd/apidoc/docs.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/apidoc/swagger.json

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries.sql.go

Lines changed: 8 additions & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/queries/insights.sql

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
SELECT
77
workspace_agent_stats.user_id,
88
users.username,
9+
users.avatar_url,
910
array_agg(DISTINCT template_id)::uuid[] AS template_ids,
1011
coalesce((PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY connection_median_latency_ms)), -1)::FLOAT AS workspace_connection_latency_50,
1112
coalesce((PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY connection_median_latency_ms)), -1)::FLOAT AS workspace_connection_latency_95

coderd/insights.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,7 @@ func (api *API) insightsUserLatency(rw http.ResponseWriter, r *http.Request) {
117117
TemplateIDs: row.TemplateIDs,
118118
UserID: row.UserID,
119119
Username: row.Username,
120+
AvatarURL: row.AvatarURL.String,
120121
LatencyMS: codersdk.ConnectionLatency{
121122
P50: row.WorkspaceConnectionLatency50,
122123
P95: row.WorkspaceConnectionLatency95,

codersdk/insights.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,7 @@ type UserLatency struct {
4444
TemplateIDs []uuid.UUID `json:"template_ids" format:"uuid"`
4545
UserID uuid.UUID `json:"user_id" format:"uuid"`
4646
Username string `json:"username"`
47+
AvatarURL string `json:"avatar_url"`
4748
LatencyMS ConnectionLatency `json:"latency_ms"`
4849
}
4950

docs/api/insights.md

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/api/schemas.md

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/api.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1368,3 +1368,13 @@ export const getWorkspaceParameters = async (workspace: TypesGen.Workspace) => {
13681368
buildParameters,
13691369
}
13701370
}
1371+
1372+
export const getInsightsUserLatency = async (filters: {
1373+
start_time: string
1374+
end_time: string
1375+
template_ids: string
1376+
}): Promise<TypesGen.DAUsResponse> => {
1377+
const params = new URLSearchParams(filters)
1378+
const response = await axios.get(`/api/v2/insights/user-latency?${params}`)
1379+
return response.data
1380+
}

site/src/api/typesGenerated.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1176,6 +1176,7 @@ export interface UserLatency {
11761176
readonly template_ids: string[]
11771177
readonly user_id: string
11781178
readonly username: string
1179+
readonly avatar_url: string
11791180
readonly latency_ms: ConnectionLatency
11801181
}
11811182

0 commit comments

Comments
 (0)