From f47b63512df01e9cd5177a14b4c17862425fe317 Mon Sep 17 00:00:00 2001 From: Felix Arntz Date: Mon, 12 Aug 2024 09:40:11 -0700 Subject: [PATCH] Remove commented-out lines and include percentage in results. --- sql/2024/08/performance-lab-plugins-adoption.sql | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/sql/2024/08/performance-lab-plugins-adoption.sql b/sql/2024/08/performance-lab-plugins-adoption.sql index 0e68bfe..f125b26 100644 --- a/sql/2024/08/performance-lab-plugins-adoption.sql +++ b/sql/2024/08/performance-lab-plugins-adoption.sql @@ -77,7 +77,6 @@ WITH urlsWithPerformanceLabPlugins AS ( SELECT client, page, - # COUNT(DISTINCT page) OVER (PARTITION BY client) AS total, HAS_PERFORMANCE_LAB(GET_GENERATOR_CONTENTS(custom_metrics)) AS has_pl, EXTRACT_PL_PLUGINS_FROM_GENERATOR_CONTENTS(GET_GENERATOR_CONTENTS(custom_metrics)) AS plugins FROM @@ -94,9 +93,8 @@ SELECT plugin, COUNT(DISTINCT page) AS urls, COUNT(DISTINCT IF(has_pl = TRUE, page, NULL)) AS urls_with_pl, - COUNT(DISTINCT IF(has_pl = FALSE, page, NULL)) AS urls_without_pl - # ANY_VALUE(total) AS total, - # COUNT(DISTINCT page) / ANY_VALUE(total) AS pct_total + COUNT(DISTINCT IF(has_pl = FALSE, page, NULL)) AS urls_without_pl, + COUNT(DISTINCT IF(has_pl = TRUE, page, NULL)) / COUNT(DISTINCT page) AS pct_with_pl FROM urlsWithPerformanceLabPlugins, UNNEST(plugins) AS plugin