@@ -42,24 +42,6 @@ CREATE TEMP FUNCTION getLoadingClasses(attributes STRING) RETURNS STRING LANGUAG
4242 }
4343' ' ' ;
4444
45- CREATE TEMPORARY FUNCTION getResourceHints(linkNodes STRING)
46- RETURNS STRUCT< preload BOOLEAN , prefetch BOOLEAN , preconnect BOOLEAN , prerender BOOLEAN , ` dns-prefetch` BOOLEAN , ` modulepreload` BOOLEAN >
47- LANGUAGE js AS ' ' '
48- var hints = [' preload' , ' prefetch' , ' preconnect' , ' prerender' , ' dns- prefetch' , ' modulepreload' ];
49- try {
50- var linkNodes = JSON.parse(linkNodes);
51- return hints.reduce((results, hint) => {
52- results[hint] = !!linkNodes.nodes.find(link => link.rel.toLowerCase() == hint);
53- return results;
54- }, {});
55- } catch (e) {
56- return hints.reduce((results, hint) => {
57- results[hint] = false;
58- return results;
59- }, {});
60- }
61- ' ' ' ;
62-
6345WITH lcp_stats AS (
6446 SELECT
6547 client,
@@ -77,7 +59,7 @@ WITH lcp_stats AS (
7759 getFetchPriorityAttr(JSON_EXTRACT(custom_metrics, ' $.performance.lcp_elem_stats.attributes' )) AS fetchPriority,
7860 LOWER (JSON_EXTRACT_SCALAR(custom_metrics, ' $.performance.lcp_resource.initialPriority' )) AS initalPriority,
7961 LOWER (JSON_EXTRACT_SCALAR(custom_metrics, ' $.performance.lcp_resource.priority' )) AS priority,
80- getResourceHints (JSON_EXTRACT(custom_metrics, ' $.almanac.link-nodes ' ) ) AS hints
62+ CAST (JSON_EXTRACT(custom_metrics, ' $.performance.is_lcp_preloaded ' ) AS BOOL ) AS preloaded
8163 FROM
8264 ` httparchive.all.pages`
8365 WHERE
@@ -116,8 +98,8 @@ SELECT
11698 COUNTIF(initalPriority = ' high' ) / COUNT (DISTINCT page) AS pct_inital_priority_high,
11799 COUNTIF(initalPriority = ' high' AND fetchPriority = ' high' ) / COUNT (DISTINCT page) AS pct_inital_priority_high_and_fetchpriority,
118100 COUNTIF(loading = ' lazy' AND fetchPriority = ' high' ) / COUNT (DISTINCT page) AS pct_native_lazyload_and_fetch_priority,
119- COUNTIF(hints . preload ) AS preload,
120- COUNTIF(hints . preload ) / COUNT (DISTINCT page) AS pct_preload
101+ COUNTIF(preloaded ) AS preload,
102+ COUNTIF(preloaded ) / COUNT (DISTINCT page) AS pct_preload
121103FROM
122104 lcp_stats
123105JOIN (
0 commit comments