Skip to content

Commit

Permalink
lcp element
Browse files Browse the repository at this point in the history
  • Loading branch information
rviscomi committed Oct 16, 2021
1 parent 23445b8 commit 28994da
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions sql/2021/performance/lcp_element.sql
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,24 @@ SELECT
_TABLE_SUFFIX AS client,
JSON_EXTRACT_SCALAR(payload, "$._performance.lcp_elem_stats[0].nodeName") AS lcp_node,
COUNT(DISTINCT url) AS pages,
SUM(COUNT(DISTINCT url)) OVER (PARTITION BY _TABLE_SUFFIX) AS total,
COUNT(DISTINCT url) / SUM(COUNT(DISTINCT url)) OVER (PARTITION BY _TABLE_SUFFIX) AS pct
ANY_VALUE(total) AS total,
COUNT(DISTINCT url) / ANY_VALUE(total) AS pct
FROM
`httparchive.pages.2021_07_01_*`
JOIN (
SELECT
_TABLE_SUFFIX,
COUNT(0) AS total
FROM
`httparchive.summary_pages.2021_07_01_*`
GROUP BY
_TABLE_SUFFIX)
USING
(_TABLE_SUFFIX)
GROUP BY
client,
lcp_node
HAVING
pages > 1000
ORDER BY
client,
pct DESC

0 comments on commit 28994da

Please sign in to comment.