Skip to content

Commit

Permalink
Updated Performance content (#249)
Browse files Browse the repository at this point in the history
* fresholds and data viz

* updated metrics

* trim reviewer IDs

* rewrote inbox example
  • Loading branch information
rviscomi authored Oct 31, 2019
1 parent 8915364 commit 36282fa
Show file tree
Hide file tree
Showing 10 changed files with 199 additions and 280 deletions.
6 changes: 3 additions & 3 deletions sql/2019/07_Performance/07_03.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#standardSQL
# 07_03: % fast FCP per PSI
SELECT
ROUND(COUNTIF(fast_fcp >= .9) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .1) AND NOT(fast_fcp >= .9)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .1) * 100 / COUNT(0), 2) AS pct_slow_fcp
ROUND(COUNTIF(fast_fcp >= .75) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .25) AND NOT(fast_fcp >= .75)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .25) * 100 / COUNT(0), 2) AS pct_slow_fcp
FROM
`chrome-ux-report.materialized.metrics_summary`
WHERE
Expand Down
6 changes: 3 additions & 3 deletions sql/2019/07_Performance/07_03b.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
# 07_03b: % fast FCP per PSI by device
SELECT
device,
ROUND(COUNTIF(fast_fcp >= .9) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .1) AND NOT(fast_fcp >= .9)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .1) * 100 / COUNT(0), 2) AS pct_slow_fcp
ROUND(COUNTIF(fast_fcp >= .75) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .25) AND NOT(fast_fcp >= .75)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .25) * 100 / COUNT(0), 2) AS pct_slow_fcp
FROM (
SELECT
device,
Expand Down
10 changes: 5 additions & 5 deletions sql/2019/07_Performance/07_03c.sql
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
# 07_03c: % fast FCP per PSI by ECT
SELECT
speed,
ROUND(COUNTIF(fast_fcp >= .9) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .1) AND NOT(fast_fcp >= .9)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .1) * 100 / COUNT(0), 2) AS pct_slow_fcp
ROUND(COUNTIF(fast_fcp >= .75) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .25) AND NOT(fast_fcp >= .75)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .25) * 100 / COUNT(0), 2) AS pct_slow_fcp
FROM (
SELECT
effective_connection_type.name AS speed,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start < 1000, bin.density, 0)), SUM(bin.density)), 4) AS fast_fcp,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 1000 AND bin.start < 2500, bin.density, 0)), SUM(bin.density)), 4) AS avg_fcp,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 2500, bin.density, 0)), SUM(bin.density)), 4) AS slow_fcp
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 1000 AND bin.start < 3000, bin.density, 0)), SUM(bin.density)), 4) AS avg_fcp,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 3000, bin.density, 0)), SUM(bin.density)), 4) AS slow_fcp
FROM
`chrome-ux-report.all.201907`,
UNNEST(first_contentful_paint.histogram.bin) AS bin
Expand Down
10 changes: 5 additions & 5 deletions sql/2019/07_Performance/07_03d.sql
Original file line number Diff line number Diff line change
Expand Up @@ -244,15 +244,15 @@ WITH geos AS (
SELECT
geo,
COUNT(0) AS websites,
ROUND(COUNTIF(fast_fcp >= .9) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .1) AND NOT(fast_fcp >= .9)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .1) * 100 / COUNT(0), 2) AS pct_slow_fcp
ROUND(COUNTIF(fast_fcp >= .75) * 100 / COUNT(0), 2) AS pct_fast_fcp,
ROUND(COUNTIF(NOT(slow_fcp >= .25) AND NOT(fast_fcp >= .75)) * 100 / COUNT(0), 2) AS pct_avg_fcp,
ROUND(COUNTIF(slow_fcp >= .25) * 100 / COUNT(0), 2) AS pct_slow_fcp
FROM (
SELECT
geo,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start < 1000, bin.density, 0)), SUM(bin.density)), 4) AS fast_fcp,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 1000 AND bin.start < 2500, bin.density, 0)), SUM(bin.density)), 4) AS avg_fcp,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 2500, bin.density, 0)), SUM(bin.density)), 4) AS slow_fcp
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 1000 AND bin.start < 3000, bin.density, 0)), SUM(bin.density)), 4) AS avg_fcp,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 3000, bin.density, 0)), SUM(bin.density)), 4) AS slow_fcp
FROM
geos,
UNNEST(first_contentful_paint.histogram.bin) AS bin
Expand Down
6 changes: 3 additions & 3 deletions sql/2019/07_Performance/07_04c.sql
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@ SELECT
FROM (
SELECT
effective_connection_type.name AS speed,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start < 50, bin.density, 0)), SUM(bin.density)), 4) AS fast_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 50 AND bin.start < 250, bin.density, 0)), SUM(bin.density)), 4) AS avg_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 250, bin.density, 0)), SUM(bin.density)), 4) AS slow_fid
ROUND(SAFE_DIVIDE(SUM(IF(bin.start < 100, bin.density, 0)), SUM(bin.density)), 4) AS fast_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 100 AND bin.start < 300, bin.density, 0)), SUM(bin.density)), 4) AS avg_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 300, bin.density, 0)), SUM(bin.density)), 4) AS slow_fid
FROM
`chrome-ux-report.all.201907`,
UNNEST(experimental.first_input_delay.histogram.bin) AS bin
Expand Down
6 changes: 3 additions & 3 deletions sql/2019/07_Performance/07_04d.sql
Original file line number Diff line number Diff line change
Expand Up @@ -250,9 +250,9 @@ SELECT
FROM (
SELECT
geo,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start < 50, bin.density, 0)), SUM(bin.density)), 4) AS fast_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 50 AND bin.start < 250, bin.density, 0)), SUM(bin.density)), 4) AS avg_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 250, bin.density, 0)), SUM(bin.density)), 4) AS slow_fid
ROUND(SAFE_DIVIDE(SUM(IF(bin.start < 100, bin.density, 0)), SUM(bin.density)), 4) AS fast_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 100 AND bin.start < 300, bin.density, 0)), SUM(bin.density)), 4) AS avg_fid,
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 300, bin.density, 0)), SUM(bin.density)), 4) AS slow_fid
FROM
geos,
UNNEST(experimental.first_input_delay.histogram.bin) AS bin
Expand Down
6 changes: 3 additions & 3 deletions sql/2019/07_Performance/07_08.sql
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
#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
ROUND(COUNTIF(fast_ttfb >= .75) * 100 / COUNT(0), 2) AS pct_fast_ttfb,
ROUND(COUNTIF(NOT(slow_ttfb >= .25) AND NOT(fast_ttfb >= .75)) * 100 / COUNT(0), 2) AS pct_avg_ttfb,
ROUND(COUNTIF(slow_ttfb >= .25) * 100 / COUNT(0), 2) AS pct_slow_ttfb
FROM
`chrome-ux-report.materialized.metrics_summary`
WHERE
Expand Down
8 changes: 4 additions & 4 deletions sql/2019/07_Performance/07_08d.sql
Original file line number Diff line number Diff line change
Expand Up @@ -244,9 +244,9 @@ WITH geos AS (
SELECT
geo,
COUNT(0) AS websites,
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
ROUND(COUNTIF(fast_ttfb >= .75) * 100 / COUNT(0), 2) AS pct_fast_ttfb,
ROUND(COUNTIF(NOT(slow_ttfb >= .25) AND NOT(fast_ttfb >= .75)) * 100 / COUNT(0), 2) AS pct_avg_ttfb,
ROUND(COUNTIF(slow_ttfb >= .25) * 100 / COUNT(0), 2) AS pct_slow_ttfb
FROM (
SELECT
geo,
Expand All @@ -255,7 +255,7 @@ FROM (
ROUND(SAFE_DIVIDE(SUM(IF(bin.start >= 1000, bin.density, 0)), SUM(bin.density)), 4) AS slow_ttfb
FROM
geos,
UNNEST(experimental.first_input_delay.histogram.bin) AS bin
UNNEST(experimental.time_to_first_byte.histogram.bin) AS bin
GROUP BY
origin,
geo)
Expand Down
Loading

0 comments on commit 36282fa

Please sign in to comment.