forked from HTTPArchive/almanac.httparchive.org
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathspeculation_rules_rank.sql
More file actions
29 lines (29 loc) · 1023 Bytes
/
speculation_rules_rank.sql
File metadata and controls
29 lines (29 loc) · 1023 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
SELECT
IF(ranking < 100000000, CAST(ranking AS STRING), 'all') AS ranking,
client,
COUNT(DISTINCT page) AS total_sites,
COUNTIF(
custom_metrics.performance.speculation_rules IS NOT NULL AND (
ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.htmlRules)) > 0 OR
ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.httpHeaderRules)) > 0
)
) AS sites_with_speculation_rules,
COUNTIF(
custom_metrics.performance.speculation_rules IS NOT NULL AND (
ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.htmlRules)) > 0 OR
ARRAY_LENGTH(JSON_QUERY_ARRAY(custom_metrics.performance.speculation_rules.httpHeaderRules)) > 0
)
) / COUNT(DISTINCT page) AS pct_speculation_rules
FROM
`httparchive.crawl.pages`,
UNNEST([1000, 10000, 100000, 1000000, 10000000, 100000000]) AS ranking
WHERE
date = '2025-07-01' AND
is_root_page AND
rank <= ranking
GROUP BY
ranking,
client
ORDER BY
ranking,
client