зеркало из https://github.com/mozilla/docker-etl.git
Remove outdated forecasts.
Expected forecast output: 1. QDAU for desktop 2. DAU for mobile No CDOU or QCDOU measures.
This commit is contained in:
Родитель
d9e4f45270
Коммит
3bc5594215
|
@ -1,40 +0,0 @@
|
|||
WITH
|
||||
cd_dau AS (
|
||||
SELECT
|
||||
submission_date,
|
||||
100 * COUNTIF(scalar_parent_browser_engagement_total_uri_count_sum > 0 AND active_hours_sum > 0) AS uri_at_dau_cd
|
||||
FROM telemetry.clients_daily
|
||||
WHERE submission_date >= DATE(2017,1,1)
|
||||
AND sample_id = 0
|
||||
GROUP BY 1
|
||||
ORDER BY 1
|
||||
)
|
||||
,
|
||||
|
||||
main_clients AS (
|
||||
SELECT
|
||||
DATE(submission_timestamp) AS submission_date,
|
||||
client_id,
|
||||
COALESCE(SUM(payload.processes.parent.scalars.browser_engagement_total_uri_count_normal_and_private_mode), 0) AS normal_private,
|
||||
COALESCE(SUM(payload.processes.parent.scalars.browser_engagement_total_uri_count), 0) AS normal,
|
||||
COALESCE(SUM(payload.processes.parent.scalars.browser_engagement_active_ticks), 0) AS active_ticks,
|
||||
FROM telemetry.main
|
||||
WHERE DATE(submission_timestamp) >= DATE(2020,12,1)
|
||||
AND sample_id = 0
|
||||
GROUP BY 1, 2
|
||||
)
|
||||
,
|
||||
|
||||
main_dau AS (
|
||||
SELECT
|
||||
submission_date,
|
||||
100 * COUNTIF((normal > 0 OR normal_private > 0) and active_ticks > 0) AS uri_dau_either_at,
|
||||
FROM main_clients
|
||||
GROUP BY 1
|
||||
)
|
||||
|
||||
SELECT
|
||||
*
|
||||
FROM cd_dau
|
||||
LEFT JOIN main_dau
|
||||
USING(submission_date)
|
|
@ -1,6 +0,0 @@
|
|||
SELECT
|
||||
submission_date,
|
||||
SUM(dau) AS DAU
|
||||
FROM telemetry.firefox_desktop_usage_2021
|
||||
GROUP BY 1
|
||||
ORDER BY 1
|
|
@ -1,8 +0,0 @@
|
|||
SELECT
|
||||
submission_date,
|
||||
COUNTIF(active_hours_sum > 0 AND uri_count > 0) AS qcdou
|
||||
FROM telemetry.unified_metrics
|
||||
WHERE normalized_app_name = 'Firefox Desktop'
|
||||
AND submission_date >= DATE(2017,1,1)
|
||||
GROUP BY 1
|
||||
ORDER BY 1
|
|
@ -1,4 +1,6 @@
|
|||
-- use unified_metrics as the source of truth for KPIs
|
||||
-- Use unified_metrics as the source of truth for KPIs
|
||||
-- QDAU is aggregated to calculate QCDOU.
|
||||
-- Forecasting procedure for QCDOU: Forecast QDAU then aggregate to QCDOU. QCDOU should not be forecasted directly.
|
||||
SELECT
|
||||
submission_date,
|
||||
COUNTIF(normalized_app_name = 'Firefox Desktop' AND active_hours_sum > 0 AND uri_count > 0) AS QDAU,
|
||||
|
|
|
@ -1,18 +1,11 @@
|
|||
WITH mobile AS
|
||||
(SELECT submission_date,
|
||||
sum(dau) AS dau
|
||||
FROM telemetry.mobile_usage_2021
|
||||
WHERE submission_date BETWEEN DATE(2020, 1, 1) AND CURRENT_DATE
|
||||
AND app_name IN ('firefox_ios',
|
||||
'fennec',
|
||||
'fenix',
|
||||
'focus_android',
|
||||
'focus_ios')
|
||||
GROUP BY submission_date
|
||||
)
|
||||
SELECT *,
|
||||
sum(dau) OVER (PARTITION BY extract(YEAR
|
||||
FROM submission_date)
|
||||
ORDER BY submission_date ASC ROWS BETWEEN UNBOUNDED PRECEDING AND CURRENT ROW) AS cdou
|
||||
FROM mobile
|
||||
ORDER BY submission_date
|
||||
-- Use unified_metrics as the source of truth for KPIs
|
||||
-- DAU is aggregated to calculate CDOU.
|
||||
-- Forecasting procedure for CDOU: Forecast DAU then aggregate to CDOU. CDOU should not be forecasted directly.
|
||||
SELECT
|
||||
submission_date,
|
||||
COUNTIF(normalized_app_name != 'Firefox Desktop') AS DAU
|
||||
FROM telemetry.unified_metrics
|
||||
WHERE `mozfun`.bits28.active_in_range(days_seen_bits, 0, 1)
|
||||
AND submission_date >= DATE(2018,1,1)
|
||||
GROUP BY 1
|
||||
ORDER BY 1
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
SELECT
|
||||
submission_date,
|
||||
COUNTIF(normalized_app_name != 'Firefox Desktop') AS DAU
|
||||
FROM telemetry.unified_metrics
|
||||
WHERE `mozfun`.bits28.active_in_range(days_seen_bits, 0, 1)
|
||||
AND submission_date >= DATE(2018,1,1)
|
||||
GROUP BY 1
|
||||
ORDER BY 1
|
|
@ -1,18 +0,0 @@
|
|||
---
|
||||
target: desktop
|
||||
query_name: "desktop_qcdou.sql"
|
||||
dataset_project: "mozdata"
|
||||
forecast_variable: "QCDOU"
|
||||
forecast_parameters:
|
||||
changepoint_prior_scale: 0.05
|
||||
changepoint_range: 0.8
|
||||
seasonality_prior_scale: 0.01
|
||||
columns:
|
||||
- submission_date
|
||||
- qcdou
|
||||
write_project: "moz-fx-data-shared-prod"
|
||||
output_table: "telemetry_derived.kpi_automated_forecast_v1"
|
||||
confidences_table: "telemetry_derived.kpi_automated_forecast_confidences_v1"
|
||||
stop_date: "2023-12-31"
|
||||
holidays: True
|
||||
confidences: "ds_month"
|
|
@ -1,18 +0,0 @@
|
|||
---
|
||||
target: mobile
|
||||
query_name: "mobile_dau.sql"
|
||||
dataset_project: "mozdata"
|
||||
forecast_variable: "CDOU"
|
||||
forecast_parameters:
|
||||
changepoint_prior_scale: 0.05
|
||||
changepoint_range: 0.8
|
||||
seasonality_prior_scale: 0.01
|
||||
columns:
|
||||
- submission_date
|
||||
- cdou
|
||||
write_project: "moz-fx-data-shared-prod"
|
||||
output_table: "telemetry_derived.kpi_automated_forecast_v1"
|
||||
confidences_table: "telemetry_derived.kpi_automated_forecast_confidences_v1"
|
||||
stop_date: "2023-12-31"
|
||||
holidays: True
|
||||
confidences: "ds_month"
|
|
@ -1,6 +1,6 @@
|
|||
---
|
||||
target: mobile
|
||||
query_name: "mobile_dau_v2.sql"
|
||||
query_name: "mobile_dau.sql"
|
||||
dataset_project: "mozdata"
|
||||
forecast_variable: "DAU"
|
||||
forecast_parameters:
|
||||
|
|
Загрузка…
Ссылка в новой задаче