Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Queue Time Histogram][DB Schema] #6418

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 5 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions clickhouse_db_schema/oss_ci_job_queue_time_historical/schema.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
-- This table is used to keep track of snapshots of in-queue jobs
CREATE TABLE misc.oss_ci_job_queue_time_historical(
`queue_s` UInt64,
`repo` String DEFAULT 'pytorch/pytorch',
`workflow_name` String,
`job_name` String,
`html_url` String,
`machine_type` String,
`time` DateTime64(9),
-- The raw records on S3, this is populated by the s3 replicator
`_meta` Tuple(bucket String, key String)
)
ENGINE = SharedMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}')
PARTITION BY toYYYYMM(time)
ORDER BY (
repo,
time,
machine_type,
job_name,
workflow_name,
)
TTL toDate(time) + toIntervalYear(5)
SETTINGS index_granularity = 8192
20 changes: 11 additions & 9 deletions clickhouse_db_schema/oss_ci_queue_time_histogram/schema.sql
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
-- This table is used to store queue time histogram
CREATE TABLE misc.oss_ci_queue_time_histogram(
`created_at` DateTime64(0, 'UTC'),
`time_stamp` DateTime64(0, 'UTC'),
-- the type of histogram, currently we store two types of histogram:
-- 'in-queue-histogram','completed-queue-histogram'
`type` String,
`repo` String DEFAULT 'pytorch/pytorch',
`workflow_name` String,
Expand All @@ -9,19 +10,20 @@ CREATE TABLE misc.oss_ci_queue_time_histogram(
`histogram_version` String,
`histogram` Array(UInt64),
`max_queue_time` UInt64,
`avg_queue_time` UInt64,
`total_count` UInt64,
`time` DateTime64(9),
`extra_info` Map(String,String)
)
ENGINE = SharedMergeTree('/clickhouse/tables/{uuid}/{shard}', '{replica}')
PARTITION BY toYYYYMM(created_at)
PARTITION BY toYYYYMM(time)
ORDER BY (
job_name,
workflow_name,
type,
repo,
time,
machine_type,
job_name,
time_stamp,
repo,
type,
workflow_name,
)
TTL toDate(time_stamp) + toIntervalYear(5)
TTL toDate(time) + toIntervalYear(5)
SETTINGS index_granularity = 8192