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

Skip to content

Commit a5ff3ff

Browse files
committed
revert p95 -> p90/p99 change
1 parent f6f6b82 commit a5ff3ff

File tree

11 files changed

+17
-40
lines changed

11 files changed

+17
-40
lines changed

coderd/apidoc/docs.go

Lines changed: 1 addition & 5 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: 1 addition & 5 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

coderd/database/dbmem/dbmem.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4352,8 +4352,7 @@ func (q *FakeQuerier) GetUserLatencyInsights(_ context.Context, arg database.Get
43524352
AvatarURL: user.AvatarURL,
43534353
TemplateIDs: templateIDs,
43544354
WorkspaceConnectionLatency50: tryPercentile(latencies, 50),
4355-
WorkspaceConnectionLatency90: tryPercentile(latencies, 90),
4356-
WorkspaceConnectionLatency99: tryPercentile(latencies, 99),
4355+
WorkspaceConnectionLatency95: tryPercentile(latencies, 95),
43574356
}
43584357
rows = append(rows, row)
43594358
}

coderd/database/queries.sql.go

Lines changed: 3 additions & 6 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 & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ SELECT
99
u.avatar_url,
1010
array_agg(DISTINCT tus.template_id)::uuid[] AS template_ids,
1111
COALESCE((PERCENTILE_CONT(0.5) WITHIN GROUP (ORDER BY tus.median_latency_ms)), -1)::float AS workspace_connection_latency_50,
12-
COALESCE((PERCENTILE_CONT(0.90) WITHIN GROUP (ORDER BY tus.median_latency_ms)), -1)::float AS workspace_connection_latency_90,
13-
COALESCE((PERCENTILE_CONT(0.99) WITHIN GROUP (ORDER BY tus.median_latency_ms)), -1)::float AS workspace_connection_latency_99
12+
COALESCE((PERCENTILE_CONT(0.95) WITHIN GROUP (ORDER BY tus.median_latency_ms)), -1)::float AS workspace_connection_latency_95
1413
FROM
1514
template_usage_stats tus
1615
JOIN

coderd/insights.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -215,8 +215,7 @@ func (api *API) insightsUserLatency(rw http.ResponseWriter, r *http.Request) {
215215
AvatarURL: row.AvatarURL,
216216
LatencyMS: codersdk.ConnectionLatency{
217217
P50: row.WorkspaceConnectionLatency50,
218-
P90: row.WorkspaceConnectionLatency90,
219-
P99: row.WorkspaceConnectionLatency99,
218+
P95: row.WorkspaceConnectionLatency95,
220219
},
221220
})
222221
}

coderd/insights_test.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,8 +318,7 @@ func TestUserLatencyInsights(t *testing.T) {
318318
require.Len(t, userLatencies.Report.Users, 1, "want only 1 user")
319319
require.Equal(t, userLatencies.Report.Users[0].UserID, user.UserID, "want user id to match")
320320
assert.Greater(t, userLatencies.Report.Users[0].LatencyMS.P50, float64(0), "want p50 to be greater than 0")
321-
assert.Greater(t, userLatencies.Report.Users[0].LatencyMS.P90, float64(0), "want p90 to be greater than 0")
322-
assert.Greater(t, userLatencies.Report.Users[0].LatencyMS.P99, float64(0), "want p99 to be greater than 0")
321+
assert.Greater(t, userLatencies.Report.Users[0].LatencyMS.P95, float64(0), "want p95 to be greater than 0")
323322
}
324323

325324
func TestUserLatencyInsights_BadRequest(t *testing.T) {

codersdk/insights.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ type UserActivity struct {
9898
// ConnectionLatency shows the latency for a connection.
9999
type ConnectionLatency struct {
100100
P50 float64 `json:"p50" example:"31.312"`
101-
P90 float64 `json:"p90" example:"119.832"`
102-
P99 float64 `json:"p99" example:"432.34"`
101+
P95 float64 `json:"p95" example:"119.832"`
103102
}
104103

105104
type UserLatencyInsightsRequest struct {

docs/api/insights.md

Lines changed: 1 addition & 2 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: 5 additions & 10 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

site/src/api/typesGenerated.ts

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

0 commit comments

Comments
 (0)