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

Update bucketlistDB size check #91

Merged
merged 2 commits into from
Sep 13, 2024
Merged
Changes from all 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
13 changes: 10 additions & 3 deletions tests/bucketlist_db_size_check.sql
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,21 @@
)
}}

with bucketlist_db_size as (
with bucket_max_size as (
select
bucket_list_target_size_bytes
from {{ ref('config_settings_current') }}
where true
and config_setting_id = 2
)
, bucketlist_db_size as (
select sequence,
closed_at,
total_byte_size_of_bucket_list / 1000000000 as bl_db_gb
from {{ ref('stg_history_ledgers') }}
where closed_at >= TIMESTAMP_SUB('{{ dbt_airflow_macros.ts(timezone=none) }}', INTERVAL 1 HOUR )
-- alert when the bucketlist has grown larger than 12 gb
and total_byte_size_of_bucket_list / 1000000000 >= 12
-- alert when the bucketlist has grown larger than 1 gb from bucket_list_target_size_bytes
and total_byte_size_of_bucket_list > (select bucket_list_target_size_bytes - 1000000000 from bucket_max_size)
)

select * from bucketlist_db_size
Loading