Skip to content

Instantly share code, notes, and snippets.

@marcelduran
Last active December 18, 2015 19:19
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save marcelduran/5832385 to your computer and use it in GitHub Desktop.
I always wondered what could be a good "page speed" metric. Since most pages have a few kbytes of payload and take a few seconds to load kbps (kilobytes per second) could be a good metric. The following httparchive bigquery shows the "page speed" in kbps quantiles as well as min, max, avg and count for both desktop and mobile pages.Check it out h…
SELECT client + ' (' + STRING(volume) + ')' AS client, mean, q_10th, q_25th, median, q_75th, q_90th, q_95th, q_99th
FROM
(SELECT
'desktop' AS client,
COUNT(0) AS volume,
AVG((bytesTotal / 1024) / (fullyLoaded / 1000)) as mean,
NTH(101, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_10th,
NTH(251, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_25th,
NTH(501, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS median,
NTH(751, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_75th,
NTH(901, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_90th,
NTH(951, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_95th,
NTH(991, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_99th
FROM [httparchive:runs.latest_pages]),
(SELECT
'mobile' AS client,
COUNT(0) AS volume,
AVG((bytesTotal / 1024) / (fullyLoaded / 1000)) AS mean,
NTH(101, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_10th,
NTH(251, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_25th,
NTH(501, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS median,
NTH(751, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_75th,
NTH(901, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_90th,
NTH(951, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_95th,
NTH(991, QUANTILES((bytesTotal / 1024) / (fullyLoaded / 1000), 1001)) AS q_99th
FROM [httparchive:runs.latest_pages_mobile])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment