Skip to content

Commit 52f2af2

Browse files
authored
[EZ] Tweak queued_jobs_aggregate query columns (#6014)
Changes: - Rename two columns to make them less confusing - Replace the full repo name column with one that just has the repo name (without the org) to make just the repo name easier to parse out This query isn't used anywhere yet so these changes are still safe to make
1 parent 7522a0d commit 52f2af2

File tree

1 file changed

+7
-7
lines changed
  • torchci/clickhouse_queries/queued_jobs_aggregate

1 file changed

+7
-7
lines changed

torchci/clickhouse_queries/queued_jobs_aggregate/query.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
--- have had jobs waiting for them for a significant period of time.
33
---
44
--- This query returns the number of jobs per runner type that have been
5-
--- queued for too long, which the autoscalers use to determin how many
5+
--- queued for too long, which the autoscalers use to determine how many
66
--- additional runners to spin up.
77

88
with possible_queued_jobs as (
@@ -28,7 +28,7 @@ with possible_queued_jobs as (
2828
CURRENT_TIMESTAMP()
2929
) AS queue_m,
3030
workflow.repository.owner.login as org,
31-
workflow.repository.full_name as full_repo,
31+
workflow.repository.name as repo,
3232
CONCAT(workflow.name, ' / ', job.name) AS name,
3333
job.html_url,
3434
IF(
@@ -61,11 +61,11 @@ with possible_queued_jobs as (
6161
select
6262
runner_label,
6363
org,
64-
full_repo,
64+
repo,
6565
count(*) as num_queued_jobs,
66-
min(queue_m) as min_queue_time_min,
67-
max(queue_m) as max_queue_time_min
66+
min(queue_m) as min_queue_time_minutes,
67+
max(queue_m) as max_queue_time_minutes
6868
from queued_jobs
69-
group by runner_label, org, full_repo
70-
order by max_queue_time_min desc
69+
group by runner_label, org, repo
70+
order by max_queue_time_minutes desc
7171
settings allow_experimental_analyzer = 1;

0 commit comments

Comments
 (0)