Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf91b3ac

Browse files
authored
fix: group routine workspace agent stats by id (#6601)
Before this was creating separate rows for distinct stat entries, whichresulted in significantly more data being sent to telemetry.
1 parent17bc579 commitf91b3ac

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

‎coderd/database/queries.sql.go

Lines changed: 4 additions & 1 deletion
Some generated files are not rendered by default. Learn more aboutcustomizing how changed files appear on GitHub.

‎coderd/database/queries/workspaceagentstats.sql

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,7 @@ WITH agent_stats AS (
9292
WHEREworkspace_agent_stats.created_at> $1AND connection_median_latency_ms>0GROUP BY user_id, agent_id, workspace_id, template_id
9393
), latest_agent_statsAS (
9494
SELECT
95+
a.agent_id,
9596
coalesce(SUM(session_count_vscode),0)::bigintAS session_count_vscode,
9697
coalesce(SUM(session_count_ssh),0)::bigintAS session_count_ssh,
9798
coalesce(SUM(session_count_jetbrains),0)::bigintAS session_count_jetbrains,
@@ -101,4 +102,4 @@ WITH agent_stats AS (
101102
FROM workspace_agent_statsWHERE created_at> $1
102103
)AS aWHEREa.rn=1GROUP BYa.user_id,a.agent_id,a.workspace_id,a.template_id
103104
)
104-
SELECT*FROM agent_stats,latest_agent_stats;
105+
SELECT*FROM agent_statsJOINlatest_agent_statsONagent_stats.agent_id=latest_agent_stats.agent_id;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp