From f97e2e80e38e01b04258d300f8914b1293d69ede Mon Sep 17 00:00:00 2001 From: Katie Hempenius Date: Sat, 24 Aug 2019 21:18:16 -0400 Subject: [PATCH] Page weight queries --- sql/2019/18_Page_Weight/18_01.sql | 21 +++++++++++++++++++++ sql/2019/18_Page_Weight/18_01b.sql | 21 +++++++++++++++++++++ sql/2019/18_Page_Weight/18_02.sql | 21 +++++++++++++++++++++ sql/2019/18_Page_Weight/18_02b.sql | 21 +++++++++++++++++++++ sql/2019/18_Page_Weight/18_03.sql | 15 +++++++++++++++ sql/2019/18_Page_Weight/18_04.sql | 15 +++++++++++++++ 6 files changed, 114 insertions(+) create mode 100644 sql/2019/18_Page_Weight/18_01b.sql create mode 100644 sql/2019/18_Page_Weight/18_02.sql create mode 100644 sql/2019/18_Page_Weight/18_02b.sql create mode 100644 sql/2019/18_Page_Weight/18_03.sql create mode 100644 sql/2019/18_Page_Weight/18_04.sql diff --git a/sql/2019/18_Page_Weight/18_01.sql b/sql/2019/18_Page_Weight/18_01.sql index e69de29bb2d..f2ea96a8281 100644 --- a/sql/2019/18_Page_Weight/18_01.sql +++ b/sql/2019/18_Page_Weight/18_01.sql @@ -0,0 +1,21 @@ +#standardSQL +# 18_01: Distribution of page weight by resource type and client. +SELECT + percentile, + _TABLE_SUFFIX as client, + APPROX_QUANTILES(ROUND(bytesTotal / 1024, 2), 1000)[OFFSET(percentile * 10)] AS total_kbytes, + APPROX_QUANTILES(ROUND(bytesHtml / 1024, 2), 1000)[OFFSET(percentile * 10)] AS html_kbytes, + APPROX_QUANTILES(ROUND(bytesJS / 1024, 2), 1000)[OFFSET(percentile * 10)] AS js_kbytes, + APPROX_QUANTILES(ROUND(bytesCSS / 1024, 2), 1000)[OFFSET(percentile * 10)] AS css_kbytes, + APPROX_QUANTILES(ROUND(bytesImg / 1024, 2), 1000)[OFFSET(percentile * 10)] AS img_kbytes, + APPROX_QUANTILES(ROUND(bytesOther / 1024, 2), 1000)[OFFSET(percentile * 10)] AS other_kbytes, + APPROX_QUANTILES(ROUND(bytesHtmlDoc / 1024, 2), 1000)[OFFSET(percentile * 10)] AS html_doc_kbytes +FROM + `httparchive.summary_pages.2019_07_01_*`, + UNNEST([10, 25, 50, 75, 90]) AS percentile +GROUP BY + percentile, + client +ORDER BY + client, + percentile diff --git a/sql/2019/18_Page_Weight/18_01b.sql b/sql/2019/18_Page_Weight/18_01b.sql new file mode 100644 index 00000000000..dd1cab3e85f --- /dev/null +++ b/sql/2019/18_Page_Weight/18_01b.sql @@ -0,0 +1,21 @@ +#standardSQL +# 18_01b: Distribution of page weight by resource type and client (2018). +SELECT + percentile, + _TABLE_SUFFIX as client, + APPROX_QUANTILES(ROUND(bytesTotal / 1024, 2), 1000)[OFFSET(percentile * 10)] AS total_kbytes, + APPROX_QUANTILES(ROUND(bytesHtml / 1024, 2), 1000)[OFFSET(percentile * 10)] AS html_kbytes, + APPROX_QUANTILES(ROUND(bytesJS / 1024, 2), 1000)[OFFSET(percentile * 10)] AS js_kbytes, + APPROX_QUANTILES(ROUND(bytesCSS / 1024, 2), 1000)[OFFSET(percentile * 10)] AS css_kbytes, + APPROX_QUANTILES(ROUND(bytesImg / 1024, 2), 1000)[OFFSET(percentile * 10)] AS img_kbytes, + APPROX_QUANTILES(ROUND(bytesOther / 1024, 2), 1000)[OFFSET(percentile * 10)] AS other_kbytes, + APPROX_QUANTILES(ROUND(bytesHtmlDoc / 1024, 2), 1000)[OFFSET(percentile * 10)] AS html_doc_kbytes +FROM + `httparchive.summary_pages.2018_07_01_*`, + UNNEST([10, 25, 50, 75, 90]) AS percentile +GROUP BY + percentile, + client +ORDER BY + client, + percentile diff --git a/sql/2019/18_Page_Weight/18_02.sql b/sql/2019/18_Page_Weight/18_02.sql new file mode 100644 index 00000000000..09e2cf0a354 --- /dev/null +++ b/sql/2019/18_Page_Weight/18_02.sql @@ -0,0 +1,21 @@ +#standardSQL +# 18_02: Distribution of requests by resource type and client +SELECT + percentile, + _TABLE_SUFFIX as client, + APPROX_QUANTILES(reqTotal, 1000)[OFFSET(percentile * 10)] AS total_req, + APPROX_QUANTILES(reqHtml, 1000)[OFFSET(percentile * 10)] AS html_req, + APPROX_QUANTILES(reqJS, 1000)[OFFSET(percentile * 10)] AS js_req, + APPROX_QUANTILES(reqCSS, 1000)[OFFSET(percentile * 10)] AS css_req, + APPROX_QUANTILES(reqImg, 1000)[OFFSET(percentile * 10)] AS img_req, + APPROX_QUANTILES(reqJson, 1000)[OFFSET(percentile * 10)] AS json_req, + APPROX_QUANTILES(reqOther, 1000)[OFFSET(percentile * 10)] AS other_req +FROM + `httparchive.summary_pages.2019_07_01_*`, + UNNEST([10, 25, 50, 75, 90]) AS percentile +GROUP BY + percentile, + client +ORDER BY + client, + percentile diff --git a/sql/2019/18_Page_Weight/18_02b.sql b/sql/2019/18_Page_Weight/18_02b.sql new file mode 100644 index 00000000000..0f917ae1dd0 --- /dev/null +++ b/sql/2019/18_Page_Weight/18_02b.sql @@ -0,0 +1,21 @@ +#standardSQL +# 18_02b: Distribution of requests by resource type and client (2018) +SELECT + percentile, + _TABLE_SUFFIX as client, + APPROX_QUANTILES(reqTotal, 1000)[OFFSET(percentile * 10)] AS total_req, + APPROX_QUANTILES(reqHtml, 1000)[OFFSET(percentile * 10)] AS html_req, + APPROX_QUANTILES(reqJS, 1000)[OFFSET(percentile * 10)] AS js_req, + APPROX_QUANTILES(reqCSS, 1000)[OFFSET(percentile * 10)] AS css_req, + APPROX_QUANTILES(reqImg, 1000)[OFFSET(percentile * 10)] AS img_req, + APPROX_QUANTILES(reqJson, 1000)[OFFSET(percentile * 10)] AS json_req, + APPROX_QUANTILES(reqOther, 1000)[OFFSET(percentile * 10)] AS other_req +FROM + `httparchive.summary_pages.2018_07_01_*`, + UNNEST([10, 25, 50, 75, 90]) AS percentile +GROUP BY + percentile, + client +ORDER BY + client, + percentile diff --git a/sql/2019/18_Page_Weight/18_03.sql b/sql/2019/18_Page_Weight/18_03.sql new file mode 100644 index 00000000000..aba07cbf0a9 --- /dev/null +++ b/sql/2019/18_Page_Weight/18_03.sql @@ -0,0 +1,15 @@ +#standardSQL +# 18_03: Distribution of response size by response format +SELECT + percentile, + format, + APPROX_QUANTILES(ROUND(respSize / 1024, 2), 1000)[OFFSET(percentile * 10)] AS resp_size +FROM + `httparchive.summary_requests.2019_07_01_*`, + UNNEST([10, 25, 50, 75, 90]) AS percentile +GROUP BY + percentile, + format +ORDER BY + format, + percentile diff --git a/sql/2019/18_Page_Weight/18_04.sql b/sql/2019/18_Page_Weight/18_04.sql new file mode 100644 index 00000000000..711495b72e2 --- /dev/null +++ b/sql/2019/18_Page_Weight/18_04.sql @@ -0,0 +1,15 @@ +#standardSQL +# 18_04: Distribution of response size by response type +SELECT + percentile, + type, + APPROX_QUANTILES(ROUND(respSize / 1024, 2), 1000)[OFFSET(percentile * 10)] AS resp_size +FROM + `httparchive.summary_requests.2019_07_01_*`, + UNNEST([10,25,50,75,90]) AS percentile +GROUP BY + percentile, + type +ORDER BY + type, + percentile