Skip to content

Commit 917997b

Browse files
committed
fix typo in query comment and improve comments
1 parent 2c8e311 commit 917997b

File tree

3 files changed

+27
-3
lines changed

3 files changed

+27
-3
lines changed

coderd/database/querier.go

Lines changed: 9 additions & 1 deletion
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: 9 additions & 1 deletion
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: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
-- name: GetUserLatencyInsights :many
2+
-- GetUserLatencyInsights returns the median and 95th percentile connection
3+
-- latency that users have experienced. The result can be filtered on
4+
-- template_ids, meaning only user data from workspaces based on those templates
5+
-- will be included.
26
SELECT
37
workspace_agent_stats.user_id,
48
users.username,
@@ -17,7 +21,7 @@ GROUP BY workspace_agent_stats.user_id, users.username
1721
ORDER BY user_id ASC;
1822

1923
-- name: GetTemplateInsights :one
20-
-- GetTemplateInsights has a garnularity of 5 minutes where if a session/app was
24+
-- GetTemplateInsights has a granularity of 5 minutes where if a session/app was
2125
-- in use, we will add 5 minutes to the total usage for that session (per user).
2226
WITH d AS (
2327
SELECT generate_series(@start_time::timestamptz, @end_time::timestamptz, '5 minute'::interval) AS d
@@ -61,6 +65,10 @@ SELECT
6165
FROM usage_by_user;
6266

6367
-- name: GetTemplateDailyInsights :many
68+
-- GetTemplateDailyInsights returns all daily intervals between start and end
69+
-- time, if end time is a partial day, it will be included in the results and
70+
-- that interval will be less than 24 hours. If there is no data for a selected
71+
-- interval/template, it will be included in the results with 0 active users.
6472
WITH d AS (
6573
-- sqlc workaround, use SELECT generate_series instead of SELECT * FROM generate_series.
6674
SELECT generate_series(@start_time::timestamptz, @end_time::timestamptz, '1 day'::interval) AS d

0 commit comments

Comments
 (0)