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

Commit7707313

Browse files
committed
Revert "use 1 minute granularity instead of 5"
This reverts commit77e8382.
1 parentf643daf commit7707313

File tree

3 files changed

+18
-18
lines changed

3 files changed

+18
-18
lines changed

‎coderd/database/querier.go

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

‎coderd/database/queries.sql.go

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

‎coderd/database/queries/insights.sql

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,17 +22,17 @@ GROUP BY workspace_agent_stats.user_id, users.username, users.avatar_url
2222
ORDER BY user_idASC;
2323

2424
-- name: GetTemplateInsights :one
25-
-- GetTemplateInsights has a granularity of1 minute where if a session/app was
26-
-- in use during a minute, we will add1 minute to the total usage for that
25+
-- GetTemplateInsights has a granularity of5 minutes where if a session/app was
26+
-- in use during a minute, we will add5 minutes to the total usage for that
2727
-- session/app (per user).
2828
WITH tsAS (
2929
SELECT
3030
d::timestamptzAS from_,
31-
(d::timestamptz+'1 minute'::interval)AS to_,
32-
EXTRACT(epochFROM'1 minute'::interval)AS seconds
31+
(d::timestamptz+'5 minute'::interval)AS to_,
32+
EXTRACT(epochFROM'5 minute'::interval)AS seconds
3333
FROM
3434
-- Subtract 1 second from end_time to avoid including the next interval in the results.
35-
generate_series(@start_time::timestamptz, (@end_time::timestamptz)-'1 second'::interval,'1 minute'::interval) d
35+
generate_series(@start_time::timestamptz, (@end_time::timestamptz)-'1 second'::interval,'5 minute'::interval) d
3636
), agent_stats_by_interval_and_userAS (
3737
SELECT
3838
ts.from_,
@@ -79,11 +79,11 @@ FROM agent_stats_by_interval_and_user;
7979
WITH tsAS (
8080
SELECT
8181
d::timestamptzAS from_,
82-
(d::timestamptz+'1 minute'::interval)AS to_,
83-
EXTRACT(epochFROM'1 minute'::interval)AS seconds
82+
(d::timestamptz+'5 minute'::interval)AS to_,
83+
EXTRACT(epochFROM'5 minute'::interval)AS seconds
8484
FROM
8585
-- Subtract 1 second from end_time to avoid including the next interval in the results.
86-
generate_series(@start_time::timestamptz, (@end_time::timestamptz)-'1 second'::interval,'1 minute'::interval) d
86+
generate_series(@start_time::timestamptz, (@end_time::timestamptz)-'1 second'::interval,'5 minute'::interval) d
8787
), app_stats_by_user_and_agentAS (
8888
SELECT
8989
ts.from_,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp