Skip to content

Instantly share code, notes, and snippets.

@senthilp
Last active April 23, 2019 23:00
Show Gist options
  • Save senthilp/519f8a5a4145e59cccc692bfcee612a6 to your computer and use it in GitHub Desktop.
Save senthilp/519f8a5a4145e59cccc692bfcee612a6 to your computer and use it in GitHub Desktop.
FCP
SELECT
origin,
effective_connection_type.name AS ect,
MULTIPLY(ROUND(SUM( first_contentful_paint.histogram.bin.density), 4), 100) AS density
FROM
[chrome-ux-report:all.201711]
WHERE
origin IN ('https://m.ebay.com', 'https://www.amazon.com') AND
form_factor.name = "phone"
GROUP BY
origin,
ect
ORDER BY
origin,
ect
SELECT
origin,
MULTIPLY(ROUND(SUM(IF(first_contentful_paint.histogram.bin.start < 1000, first_contentful_paint.histogram.bin.density , 0)) / SUM( first_contentful_paint.histogram.bin.density ), 4), 100) AS fast_AboveTheFold,
MULTIPLY(ROUND(SUM(IF(first_contentful_paint.histogram.bin.start >= 1000 AND first_contentful_paint.histogram.bin.start < 3000, first_contentful_paint.histogram.bin.density, 0)) / SUM(first_contentful_paint.histogram.bin.density), 4), 100) AS average_AboveTheFold,
MULTIPLY(ROUND(SUM(IF(first_contentful_paint.histogram.bin.start >= 3000, first_contentful_paint.histogram.bin.density, 0)) / SUM(first_contentful_paint.histogram.bin.density), 4), 100) AS slow_AboveTheFold
FROM
[chrome-ux-report:all.201903]
WHERE
origin IN ('https://www.ebay.com', 'https://www.amazon.com') AND
form_factor.name = "desktop"
GROUP BY
origin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment