Skip to content

Commit

Permalink
commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Katrindenek committed Apr 19, 2024
1 parent ee621ea commit f323d10
Show file tree
Hide file tree
Showing 8 changed files with 1,296 additions and 9 deletions.
12 changes: 5 additions & 7 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/docker-existing-dockerfile
{
"name": "Existing Dockerfile",
"build": {
// Sets the run context to one level up instead of the .devcontainer folder.
// "context": "."
// Update the 'dockerFile' property if you aren't using the standard 'Dockerfile' filename.
"dockerfile": "../Dockerfile"
},
"name": "Existing Docker Compose (Extend)",

"dockerComposeFile": "../docker-compose.yml",
"service": "devcontainer",
"workspaceFolder": "/workspaces/",

// Features to add to the dev container. More info: https://containers.dev/features.
// "features": {},
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM fishtownanalytics/dbt:${DBT_VERSION}

RUN set -ex \
&& python -m pip install --upgrade pip setuptools \
&& python -m pip install --upgrade dbt-clickhouse numpy
&& python -m pip install --upgrade dbt-clickhouse==1.5.2 numpy

WORKDIR /usr/app/
ENV DBT_PROFILES_DIR=.
Expand Down
11 changes: 10 additions & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ services:
- 8123:8123

metabase:
image: metabase/metabase:v0.44.6
image: metabase/metabase:v0.49.6
volumes:
- ./metabase/plugins:/plugins
- ./metabase/metabase.db:/metabase.db/
Expand All @@ -27,3 +27,12 @@ services:
- .env
volumes:
- .:/cube/conf

devcontainer:
build:
context: .
args:
DBT_VERSION: 1.0.0
entrypoint: ["tail", "-f", "/dev/null"]
volumes:
- .:/workspace
Binary file modified metabase/metabase.db/metabase.db.mv.db
Binary file not shown.
1,239 changes: 1,239 additions & 0 deletions metabase/metabase.db/metabase.db.trace.db

Large diffs are not rendered by default.

Binary file added metabase/metabase.db/metabase.db.v1-backup.mv.db
Binary file not shown.
32 changes: 32 additions & 0 deletions models/metrics/metrics.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,35 @@ metrics:
time_grains: [day, week, month, quarter, year]

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]

- name: bounces
label: 'Bounces'
model: ref('f_tracker')
calculation_method: sum
expression: bounces

timestamp: dt
time_grains: [day, week, month, quarter, year]

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]

- name: sessions
label: 'Sessions'
model: ref('f_tracker')
calculation_method: sum
expression: sessions

timestamp: dt
time_grains: [day, week, month, quarter, year]

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]

- name: bounce_rate
label: 'Bounce rate'
calculation_method: derived
expression: "{{metric('bounces')}} / {{metric('sessions')}}"

timestamp: dt
time_grains: [day, week, month, quarter, year]

dimensions: [traffic_grouping, traffic_source, traffic_medium, traffic_campaign, device_category, location_country]
9 changes: 9 additions & 0 deletions schema/f_tracker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,15 @@ cubes:
- name: CPC
sql: '{CUBE.costs} / nullif(coalesce({CUBE.clicks}, 1), 0)'
type: number
- name: bounces
sql: bounces
type: sum
- name: sessions
sql: sessions
type: sum
- name: bounce_rate
sql: '{CUBE.bounces}/{CUBE.sessions}'
type: number
dimensions:
- name: date
sql: 'dt'
Expand Down

0 comments on commit f323d10

Please sign in to comment.