-
Notifications
You must be signed in to change notification settings - Fork 41
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feature - Add serverless tasks and spend (#37)
* feature - Add serverless tasks and spend * fix - groupby * Update monthly_spend_fixture.csv * fix-ref * changie Co-authored-by: Niall Woodward <[email protected]>
- Loading branch information
Showing
8 changed files
with
73 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
kind: Features | ||
body: Add serverless tasks history and spend | ||
time: 2022-12-06T16:30:14.851362Z | ||
custom: | ||
Author: gthesheep | ||
PR: "37" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
{{ config(materialized='incremental') }} | ||
|
||
select | ||
start_time, | ||
end_time, | ||
task_id, | ||
task_name, | ||
database_name, | ||
credits_used | ||
from {{ source('snowflake_account_usage', 'serverless_task_history') }} | ||
|
||
{% if is_incremental() %} | ||
where end_time > (select max(end_time) from {{ this }}) | ||
{% endif %} | ||
|
||
order by start_time |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
version: 2 | ||
|
||
models: | ||
- name: stg_serverless_task_history | ||
description: An incrementally materialized copy of the snowflake.account_usage.warehouse_metering_history view. See https://docs.snowflake.com/en/sql-reference/account-usage/serverless_task_history.html | ||
columns: | ||
- name: start_time | ||
description: The date and beginning of the hour (in the UTC time zone) in which the serverless task took place. | ||
- name: end_time | ||
description: The date and end of the hour (in the UTC time zone) in which the serverless task took place. | ||
- name: task_id | ||
description: Internal/system-generated identifier for the task. | ||
- name: task_name | ||
description: Name of the task. | ||
- name: database_name | ||
description: Name of the database in which the task is located. | ||
- name: credits_used | ||
description: Total number of credits used for the task. |