Update checks to match new naming dau=daily_users & qdau=dau. (#4804)

This commit is contained in:
Lucia 2024-01-11 17:19:13 -05:00 коммит произвёл GitHub
Родитель 5ce1f9ae6e
Коммит 6bf9506ad7
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
3 изменённых файлов: 36 добавлений и 36 удалений

Просмотреть файл

@ -10,15 +10,15 @@
#}
{% raw -%}
#warn
WITH qdau_sum AS (
WITH dau_sum AS (
SELECT
SUM(qdau),
SUM(dau),
FROM
`{{ project_id }}.{{ dataset_id }}.{{ table_name }}`
WHERE
submission_date = @submission_date
),
live_table_qdau_count_base AS (
live_table_dau_count_base AS (
SELECT
client_id,
SUM(
@ -46,7 +46,7 @@ overactive AS (
SELECT
client_id
FROM
live_table_qdau_count_base
live_table_dau_count_base
GROUP BY
client_id
HAVING
@ -63,7 +63,7 @@ client_summary AS (
) AS total_uri_count,
SUM(active_ticks / (3600 / 5)) AS active_hours_sum,
FROM
live_table_qdau_count_base
live_table_dau_count_base
LEFT JOIN
overactive
USING
@ -82,7 +82,7 @@ last_seen AS (
WHERE
submission_date = @submission_date
),
live_table_qdau_count AS (
live_table_dau_count AS (
SELECT
COUNTIF(active_hours_sum > 0 AND total_uri_count > 0 AND days_since_seen = 0)
FROM
@ -94,25 +94,25 @@ live_table_qdau_count AS (
)
SELECT
IF(
ABS((SELECT * FROM qdau_sum) - (SELECT * FROM live_table_qdau_count)) > 10,
ABS((SELECT * FROM dau_sum) - (SELECT * FROM live_table_dau_count)) > 10,
ERROR(
CONCAT(
"QDAU mismatch between the live (`telemetry_live.main_v5`) and active_users_aggregates (`{{ dataset_id }}.{{ table_name }}`) tables is greater than 10.",
"DAU mismatch between the live (`telemetry_live.main_v5`) and active_users_aggregates (`{{ dataset_id }}.{{ table_name }}`) tables is greater than 10.",
" Live table count: ",
(SELECT * FROM live_table_qdau_count),
" | active_users_aggregates (QDAU): ",
(SELECT * FROM qdau_sum),
(SELECT * FROM live_table_dau_count),
" | active_users_aggregates (DAU): ",
(SELECT * FROM dau_sum),
" | Delta detected: ",
ABS((SELECT * FROM qdau_sum) - (SELECT * FROM live_table_qdau_count))
ABS((SELECT * FROM dau_sum) - (SELECT * FROM live_table_dau_count))
)
),
NULL
);
#warn
WITH dau_sum AS (
WITH daily_users_sum AS (
SELECT
SUM(dau),
SUM(daily_users),
FROM
`{{ project_id }}.{{ dataset_id }}.{{ table_name }}`
WHERE
@ -152,16 +152,16 @@ distinct_client_count AS (
)
SELECT
IF(
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 10,
ABS((SELECT * FROM daily_users_sum) - (SELECT * FROM distinct_client_count)) > 10,
ERROR(
CONCAT(
"DAU mismatch between the live (`telemetry_live.main_v5`) and active_users_aggregates (`{{ dataset_id }}.{{ table_name }}`) tables is greater than 10.",
"Daily_users mismatch between the live (`telemetry_live.main_v5`) and active_users_aggregates (`{{ dataset_id }}.{{ table_name }}`) tables is greater than 10.",
" Live table count: ",
(SELECT * FROM distinct_client_count),
" | active_users_aggregates (DAU): ",
(SELECT * FROM dau_sum),
" | active_users_aggregates (daily_users): ",
(SELECT * FROM daily_users_sum),
" | Delta detected: ",
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count))
ABS((SELECT * FROM daily_users_sum) - (SELECT * FROM distinct_client_count))
)
),
NULL

Просмотреть файл

@ -1,6 +1,6 @@
{#
We use raw here b/c the first pass is rendered to create the checks.sql
files, and the second pass is rendering of the checks themselves.
files, and the second pass is the rendering of the checks themselves.
Without/outside the {% raw %} the macros would be rendered for every
check file when we create the checks file, when `bqetl generate active_users`
is called.
@ -10,9 +10,9 @@
#}
{% raw -%}
#warn
WITH dau_sum AS (
WITH daily_users_sum AS (
SELECT
SUM(dau),
SUM(daily_users),
FROM
`{{ project_id }}.{{ dataset_id }}.{{ table_name }}`
WHERE
@ -27,9 +27,9 @@ distinct_client_count_nightly_base AS (
WHERE
DATE(submission_timestamp) = @submission_date
AND mozfun.norm.fenix_app_info("org_mozilla_fenix", client_info.app_build).channel = "nightly"
-- NOTE: the below two tables are marked as depricated inside the GLEAN dictionary
-- however, they are still considered when generating active_users_aggregates metrics
-- this is why they are being considered here.
-- NOTE: The next two tables `org_mozilla_fenix_nightly_live.baseline_v1` and `org_mozilla_fennec_aurora_live.baseline_v1`
-- are not used as application IDs in Glean, but are also not yet marked as deprecated because they still count for KPIs:
-- Related PR https://github.com/mozilla/probe-scraper/pull/640.
UNION ALL
SELECT
client_info.client_id,
@ -121,16 +121,16 @@ distinct_client_count AS (
)
SELECT
IF(
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 10,
ABS((SELECT * FROM daily_users_sum) - (SELECT * FROM distinct_client_count)) > 10,
ERROR(
CONCAT(
"DAU mismatch between the firefox_ios live (`org_mozilla_firefox_live`, `org_mozilla_fenix_live.baseline_v1`,`org_mozilla_firefox_beta_live.baseline_v1`,`org_mozilla_fenix_nightly_live.baseline_v1`, `org_mozilla_fennec_aurora_live.baseline_v1`) and active_users_aggregates (`fenix_derived.active_users_aggregates_v2`) tables is greater than 10.",
"Daily_users mismatch between the firefox_ios live (`org_mozilla_firefox_live`, `org_mozilla_fenix_live.baseline_v1`,`org_mozilla_firefox_beta_live.baseline_v1`,`org_mozilla_fenix_nightly_live.baseline_v1`, `org_mozilla_fennec_aurora_live.baseline_v1`) and active_users_aggregates (`{{ dataset_id }}.{{ table_name }}`) tables is greater than 10.",
" Live table count: ",
(SELECT * FROM distinct_client_count),
" | active_users_aggregates (DAU): ",
(SELECT * FROM dau_sum),
(SELECT * FROM daily_users_sum),
" | Delta detected: ",
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count))
ABS((SELECT * FROM daily_users_sum) - (SELECT * FROM distinct_client_count))
)
),
NULL

Просмотреть файл

@ -9,9 +9,9 @@
(you can also run them locally with `bqetl check run`).
#}
#warn
WITH dau_sum AS (
WITH daily_users_sum AS (
SELECT
SUM(dau),
SUM(daily_users),
FROM
{%- raw %}
`{{ project_id }}.{{ dataset_id }}.{{ table_name }}` {%- endraw %}
@ -43,16 +43,16 @@ distinct_client_count AS (
)
SELECT
IF(
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count)) > 10,
ABS((SELECT * FROM daily_users_sum) - (SELECT * FROM distinct_client_count)) > 10,
ERROR(
CONCAT(
"DAU mismatch between the {{ app_name }} live across all channels ({%- for channel in channels %}{{ channel.table }},{% endfor -%}) and active_users_aggregates ({%- raw %}`{{ dataset_id }}.{{ table_name }}`{%- endraw %}) tables is greater than 10.",
"Daily users mismatch between the {{ app_name }} live across all channels ({%- for channel in channels %}{{ channel.table }},{% endfor -%}) and active_users_aggregates ({%- raw %}`{{ dataset_id }}.{{ table_name }}`{%- endraw %}) tables is greater than 10.",
" Live table count: ",
(SELECT * FROM distinct_client_count),
" | active_users_aggregates (DAU): ",
(SELECT * FROM dau_sum),
" | active_users_aggregates (daily_users): ",
(SELECT * FROM daily_users_sum),
" | Delta detected: ",
ABS((SELECT * FROM dau_sum) - (SELECT * FROM distinct_client_count))
ABS((SELECT * FROM daily_users_sum) - (SELECT * FROM distinct_client_count))
)
),
NULL