Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix #1484: keep only one status per client per source and per period #1487

Merged
merged 3 commits into from
Sep 10, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions checks/remotesettings/uptake_error_rate.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@

WITH uptake_telemetry AS (
SELECT
client_id,
timestamp AS submission_timestamp,
normalized_channel,
SPLIT(app_version, '.')[OFFSET(0)] AS version,
Expand All @@ -47,6 +48,13 @@
AND event_string_value <> 'up_to_date'
{version_condition}
{channel_condition}
),
-- Enumerate all the statuses reported by a client for each source
row_number_by_client_id AS (
leplatrem marked this conversation as resolved.
Show resolved Hide resolved
SELECT
ROW_NUMBER() OVER (PARTITION BY client_id, source, status) AS rn,
*
FROM uptake_telemetry
)
SELECT
-- Min/Max timestamps of this period
Expand All @@ -57,8 +65,9 @@
normalized_channel AS channel,
version,
COUNT(*) AS total
FROM uptake_telemetry
WHERE {source_condition}
FROM row_number_by_client_id
WHERE rn = 1 -- Keep only one status per client and per source
AND {source_condition}
GROUP BY period, source, status, channel, version
ORDER BY period, source
"""
Expand Down
Loading