-
-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
390 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#standardSQL | ||
# 07_07: TTFB distribution | ||
SELECT | ||
fast, | ||
avg, | ||
slow | ||
FROM ( | ||
SELECT | ||
ROUND(fast_ttfb * 100, 2) AS fast, | ||
ROUND(avg_ttfb * 100, 2) AS avg, | ||
ROUND(slow_ttfb * 100, 2) AS slow, | ||
ROW_NUMBER() OVER (ORDER BY fast_ttfb DESC) AS row, | ||
COUNT(0) OVER () AS n | ||
FROM | ||
`chrome-ux-report.materialized.metrics_summary` | ||
WHERE | ||
date = '2019-07-01' AND | ||
fast_ttfb + avg_ttfb + slow_ttfb > 0 | ||
ORDER BY | ||
fast DESC) | ||
WHERE | ||
MOD(row, CAST(FLOOR(n / 1000) AS INT64)) = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#standardSQL | ||
# 07_07b: TTFB desktop distribution | ||
SELECT | ||
fast, | ||
avg, | ||
slow | ||
FROM ( | ||
SELECT | ||
device, | ||
ROUND(SAFE_DIVIDE(fast_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) * 100, 2) AS fast, | ||
ROUND(SAFE_DIVIDE(avg_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) * 100, 2) AS avg, | ||
ROUND(SAFE_DIVIDE(slow_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) * 100, 2) AS slow, | ||
ROW_NUMBER() OVER (ORDER BY fast_ttfb DESC) AS row, | ||
COUNT(0) OVER () AS n | ||
FROM | ||
`chrome-ux-report.materialized.device_summary` | ||
WHERE | ||
yyyymm = '201907' AND | ||
fast_ttfb + avg_ttfb + slow_ttfb > 0 AND | ||
device = 'desktop' | ||
ORDER BY | ||
fast DESC) | ||
WHERE | ||
MOD(row, CAST(FLOOR(n / 1000) AS INT64)) = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#standardSQL | ||
# 07_07c: TTFB phone distribution | ||
SELECT | ||
fast, | ||
avg, | ||
slow | ||
FROM ( | ||
SELECT | ||
device, | ||
ROUND(SAFE_DIVIDE(fast_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) * 100, 2) AS fast, | ||
ROUND(SAFE_DIVIDE(avg_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) * 100, 2) AS avg, | ||
ROUND(SAFE_DIVIDE(slow_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) * 100, 2) AS slow, | ||
ROW_NUMBER() OVER (ORDER BY fast_ttfb DESC) AS row, | ||
COUNT(0) OVER () AS n | ||
FROM | ||
`chrome-ux-report.materialized.device_summary` | ||
WHERE | ||
yyyymm = '201907' AND | ||
fast_ttfb + avg_ttfb + slow_ttfb > 0 AND | ||
device = 'phone' | ||
ORDER BY | ||
fast DESC) | ||
WHERE | ||
MOD(row, CAST(FLOOR(n / 1000) AS INT64)) = 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
#standardSQL | ||
# 07_08: % fast TTFB using FCP-like thresholds | ||
SELECT | ||
ROUND(COUNTIF(fast_ttfb >= .9) * 100 / COUNT(0), 2) AS pct_fast_ttfb, | ||
ROUND(COUNTIF(NOT(slow_ttfb >= .1) AND NOT(fast_ttfb >= .9)) * 100 / COUNT(0), 2) AS pct_avg_ttfb, | ||
ROUND(COUNTIF(slow_ttfb >= .1) * 100 / COUNT(0), 2) AS pct_slow_ttfb | ||
FROM | ||
`chrome-ux-report.materialized.metrics_summary` | ||
WHERE | ||
date = '2019-07-01' AND | ||
fast_ttfb + avg_ttfb + slow_ttfb > 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#standardSQL | ||
# 07_08b: % fast TTFB by device | ||
SELECT | ||
device, | ||
ROUND(COUNTIF(fast_ttfb >= .9) * 100 / COUNT(0), 2) AS pct_fast_ttfb, | ||
ROUND(COUNTIF(NOT(slow_ttfb >= .1) AND NOT(fast_ttfb >= .9)) * 100 / COUNT(0), 2) AS pct_avg_ttfb, | ||
ROUND(COUNTIF(slow_ttfb >= .1) * 100 / COUNT(0), 2) AS pct_slow_ttfb | ||
FROM ( | ||
SELECT | ||
device, | ||
SAFE_DIVIDE(fast_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) AS fast_ttfb, | ||
SAFE_DIVIDE(avg_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) AS avg_ttfb, | ||
SAFE_DIVIDE(slow_ttfb, fast_ttfb + avg_ttfb + slow_ttfb) AS slow_ttfb | ||
FROM | ||
`chrome-ux-report.materialized.device_summary` | ||
WHERE | ||
yyyymm = '201907' AND | ||
fast_ttfb + avg_ttfb + slow_ttfb > 0 AND | ||
device IN ('desktop', 'phone')) | ||
GROUP BY | ||
device |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
#standardSQL | ||
# 07_08c: % fast TTFB by ECT | ||
SELECT | ||
speed, | ||
ROUND(COUNTIF(fast_ttfb >= .9) * 100 / COUNT(0), 2) AS pct_fast_ttfb, | ||
ROUND(COUNTIF(NOT(slow_ttfb >= .1) AND NOT(fast_ttfb >= .9)) * 100 / COUNT(0), 2) AS pct_avg_ttfb, | ||
ROUND(COUNTIF(slow_ttfb >= .1) * 100 / COUNT(0), 2) AS pct_slow_ttfb | ||
FROM ( | ||
SELECT | ||
effective_connection_type.name AS speed, | ||
ROUND(SAFE_DIVIDE(SUM(IF(bin.start < 200, bin.density, 0)), SUM(bin.density)), 4) AS fast_ttfb, | ||
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 200 AND bin.start < 1000, bin.density, 0)), SUM(bin.density)), 4) AS avg_ttfb, | ||
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 1000, bin.density, 0)), SUM(bin.density)), 4) AS slow_ttfb | ||
FROM | ||
`chrome-ux-report.all.201907`, | ||
UNNEST(experimental.time_to_first_byte.histogram.bin) AS bin | ||
GROUP BY | ||
origin, | ||
speed) | ||
GROUP BY | ||
speed | ||
ORDER BY | ||
pct_fast_ttfb DESC |
Oops, something went wrong.