Skip to content

Commit

Permalink
fix: clarified observability dashboard (et/somenergia-jardiner!139)
Browse files Browse the repository at this point in the history
Merge branch 'fix/observabilitat' into 'main'
  • Loading branch information
Lugadur committed Mar 26, 2024
2 parents a8b3d95 + a317c1d commit 3a76b19
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -87,3 +87,29 @@ models:
columns:
- name: rebut_from_dset
description: Booleà que indica si s'ha rebut o no en l'últim batch.

- name: obs_dset_responses__expected_signals
description: >
Model temporal que compatbilitza el nombre de senyals definides als mapajos de planta.
columns:
- name: nom_planta
- name: senyals_esperades
description: totes les que estan en els mapejos
- name: no_rebudes_mai
description: mai s'ha rebut ningun valor per aquella senyal
- name: rebudes_alguna_vegada
description: alguna vegada s'ha rebut un valor per aquella senyal
- name: rebudes_avui
description: s'ha rebut alguna vegada, i tambñe avui
- name: no_rebudes_avui
description: s'ha rebut alguna vegada, pero no avui
- name: no_rebudes_total
description: suma de mai_rebudes i no_rebudes_avui
- name: obs_dset_responses__unexpected_signals
description: >
Model temporal que identifica senyals que rebem de dset però que no estan a cap maping. Per tant, no tenen nom de planta,
ni cap dada perqu eno fa match amb cap info de GA.
columns:
- name: nom_planta_dset
- name: senyals_inesperades

Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{{ config(materialized="view") }}


with esperades as (
select *
from {{ ref("dm_dset_last_reading__from_signal_last_ts") }}
where uuid_senyal is not null
)
select
nom_planta,
count(*) as senyals_esperades,
count(*) filter (where ultim_ts is null) as no_rebudes_mai,
count(*) filter (where ultim_ts is not null) as rebudes_alguna_vegada,
count(*) filter (where ultim_ts is not null and ultim_ts >= current_date) as rebudes_avui,
count(*) filter (where ultim_ts is not null and ultim_ts < current_date) as no_rebudes_avui,
count(*) filter (where ultim_ts is null or (ultim_ts is not null and ultim_ts < current_date)) as no_rebudes_total
from esperades
group by nom_planta
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
{{ config(materialized="view") }}


with inesperades as (
select *
from {{ ref("dm_dset_last_reading__from_signal_last_ts") }}
where uuid_senyal is null
)
select nom_planta_dset, count(*) as senyals_inesperades
from inesperades
group by nom_planta_dset

0 comments on commit 3a76b19

Please sign in to comment.