Skip to content

Commit e9b666e

Browse files
committed
deduplicated good_cwv
1 parent 396d664 commit e9b666e

File tree

1 file changed

+10
-14
lines changed

1 file changed

+10
-14
lines changed

Diff for: definitions/output/reports/tech_crux.js

+10-14
Original file line numberDiff line numberDiff line change
@@ -126,14 +126,14 @@ crux AS (
126126
IS_GOOD(small_cls, medium_cls, large_cls) AS good_cls,
127127
IS_NON_ZERO(fast_lcp, avg_lcp, slow_lcp) AS any_lcp,
128128
IS_GOOD(fast_lcp, avg_lcp, slow_lcp) AS good_lcp,
129-
130-
(IS_GOOD(fast_inp, avg_inp, slow_inp) OR fast_inp IS NULL) AND
131-
IS_GOOD(small_cls, medium_cls, large_cls) AND
132-
IS_GOOD(fast_lcp, avg_lcp, slow_lcp) AS good_cwv_2024,
133-
134-
(IS_GOOD(fast_fid, avg_fid, slow_fid) OR fast_fid IS NULL) AND
135-
IS_GOOD(small_cls, medium_cls, large_cls) AND
136-
IS_GOOD(fast_lcp, avg_lcp, slow_lcp) AS good_cwv_2023,
129+
IF('${pastMonth}' < '2024-01-01',
130+
(IS_GOOD(fast_fid, avg_fid, slow_fid) OR fast_fid IS NULL) AND
131+
IS_GOOD(small_cls, medium_cls, large_cls) AND
132+
IS_GOOD(fast_lcp, avg_lcp, slow_lcp),
133+
(IS_GOOD(fast_inp, avg_inp, slow_inp) OR fast_inp IS NULL) AND
134+
IS_GOOD(small_cls, medium_cls, large_cls) AND
135+
IS_GOOD(fast_lcp, avg_lcp, slow_lcp)
136+
) AS good_cwv,
137137
138138
# WV
139139
IS_NON_ZERO(fast_fcp, avg_fcp, slow_fcp) AS any_fcp,
@@ -267,13 +267,9 @@ SELECT
267267
COUNTIF(any_fcp) AS origins_with_any_fcp,
268268
COUNTIF(any_ttfb) AS origins_with_any_ttfb,
269269
COUNTIF(any_inp) AS origins_with_any_inp,
270-
COUNTIF(good_cwv_2024) AS origins_with_good_cwv,
271-
COUNTIF(good_cwv_2024) AS origins_with_good_cwv_2024,
272-
COUNTIF(good_cwv_2023) AS origins_with_good_cwv_2023,
270+
COUNTIF(good_cwv) AS origins_with_good_cwv,
273271
COUNTIF(any_lcp AND any_cls) AS origins_eligible_for_cwv,
274-
SAFE_DIVIDE(COUNTIF(good_cwv_2024), COUNTIF(any_lcp AND any_cls)) AS pct_eligible_origins_with_good_cwv,
275-
SAFE_DIVIDE(COUNTIF(good_cwv_2024), COUNTIF(any_lcp AND any_cls)) AS pct_eligible_origins_with_good_cwv_2024,
276-
SAFE_DIVIDE(COUNTIF(good_cwv_2023), COUNTIF(any_lcp AND any_cls)) AS pct_eligible_origins_with_good_cwv_2023,
272+
SAFE_DIVIDE(COUNTIF(good_cwv), COUNTIF(any_lcp AND any_cls)) AS pct_eligible_origins_with_good_cwv,
277273
278274
# Lighthouse data
279275
SAFE_CAST(APPROX_QUANTILES(accessibility, 1000)[OFFSET(500)] AS NUMERIC) AS median_lighthouse_score_accessibility,

0 commit comments

Comments
 (0)