Skip to content

Commit

Permalink
split by CMS
Browse files Browse the repository at this point in the history
  • Loading branch information
rviscomi committed Oct 15, 2019
1 parent 97f3c29 commit 4ad3d17
Show file tree
Hide file tree
Showing 4 changed files with 88 additions and 0 deletions.
25 changes: 25 additions & 0 deletions sql/2019/14_CMS/14_13d.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#standardSQL
# 14_13d: Distribution of image stats per CMS
SELECT
percentile,
_TABLE_SUFFIX AS client,
app,
COUNT(DISTINCT url) AS pages,
APPROX_QUANTILES(reqImg, 1000)[OFFSET(percentile * 10)] AS image_count,
ROUND(APPROX_QUANTILES(bytesImg, 1000)[OFFSET(percentile * 10)] / 1024, 2) AS image_kbytes
FROM
`httparchive.summary_pages.2019_07_01_*`
JOIN
`httparchive.technologies.2019_07_01_*`
USING (_TABLE_SUFFIX, url),
UNNEST([10, 25, 50, 75, 90]) AS percentile
WHERE
category = 'CMS'
GROUP BY
percentile,
client,
app
ORDER BY
percentile,
client,
pages DESC
23 changes: 23 additions & 0 deletions sql/2019/14_CMS/14_14b.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#standardSQL
# 14_14b: Distribution of HTML kilobytes per CMS per page
SELECT
_TABLE_SUFFIX AS client,
app,
COUNT(DISTINCT url) AS pages,
ROUND(APPROX_QUANTILES(bytesHtml, 1000)[OFFSET(100)] / 1024, 2) AS p10,
ROUND(APPROX_QUANTILES(bytesHtml, 1000)[OFFSET(250)] / 1024, 2) AS p25,
ROUND(APPROX_QUANTILES(bytesHtml, 1000)[OFFSET(500)] / 1024, 2) AS p50,
ROUND(APPROX_QUANTILES(bytesHtml, 1000)[OFFSET(750)] / 1024, 2) AS p75,
ROUND(APPROX_QUANTILES(bytesHtml, 1000)[OFFSET(900)] / 1024, 2) AS p90
FROM
`httparchive.summary_pages.2019_07_01_*`
JOIN
`httparchive.technologies.2019_07_01_*`
USING (_TABLE_SUFFIX, url)
WHERE
category = 'CMS'
GROUP BY
client,
app
ORDER BY
pages DESC
23 changes: 23 additions & 0 deletions sql/2019/14_CMS/14_18b.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#standardSQL
# 14_18b: Lighthouse indexability scores by CMS
SELECT
app,
COUNTIF(crawlable = '1') AS passing,
COUNT(0) AS total,
ROUND(COUNTIF(crawlable = '1') * 100 / COUNT(0) , 2) AS pct
FROM
`httparchive.technologies.2019_07_01_mobile`
JOIN (
SELECT
url,
JSON_EXTRACT_SCALAR(report, '$.audits.is-crawlable.score') AS crawlable
FROM
`httparchive.lighthouse.2019_07_01_mobile`)
USING (url)
WHERE
category = 'CMS' AND
crawlable IS NOT NULL
GROUP BY
app
ORDER BY
total DESC
17 changes: 17 additions & 0 deletions sql/2019/14_CMS/14_19b.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#standardSQL
# 14_19b: Lighthouse PWA scores by CMS
SELECT
app,
APPROX_QUANTILES(CAST(JSON_EXTRACT_SCALAR(report, "$.categories.pwa.score") AS NUMERIC), 1000)[OFFSET(501)] AS median_pwa_score,
COUNT(0) AS pages
FROM
`httparchive.lighthouse.2019_07_01_mobile`
LEFT JOIN
`httparchive.technologies.2019_07_01_mobile`
USING (url)
WHERE
category = 'CMS'
GROUP BY
app
ORDER BY
pages DESC

0 comments on commit 4ad3d17

Please sign in to comment.