Mforns has submitted this change and it was merged. (
https://gerrit.wikimedia.org/r/364631 )
Change subject: Add "desktop by browser" tab to browser reports
..
Add "desktop by browser" tab to browser reports
Reports will populate since data is available
Bug: T170286
Change-Id: Ic4990bc1da8271247a967d6d5e0397ecaaef4816
---
M browser/config.yaml
A browser/desktop_site_by_browser_family_and_major_percent
A browser/desktop_site_by_browser_family_percent
3 files changed, 74 insertions(+), 0 deletions(-)
Approvals:
Mforns: Verified; Looks good to me, approved
diff --git a/browser/config.yaml b/browser/config.yaml
index def5647..26985fa 100644
--- a/browser/config.yaml
+++ b/browser/config.yaml
@@ -113,3 +113,17 @@
granularity: weeks
starts: 2015-06-07
lag: 86400 # wait 1 day to compute last week
+
+desktop_site_by_browser_family_and_major_percent:
+type: script
+granularity: weeks
+funnel: true
+starts: 2015-06-07
+lag: 86400 # wait 1 day to compute last week
+
+desktop_site_by_browser_family_percent:
+type: script
+granularity: weeks
+starts: 2015-06-07
+lag: 86400 # wait 1 day to compute last week
+
diff --git a/browser/desktop_site_by_browser_family_and_major_percent
b/browser/desktop_site_by_browser_family_and_major_percent
new file mode 100755
index 000..77c43a3
--- /dev/null
+++ b/browser/desktop_site_by_browser_family_and_major_percent
@@ -0,0 +1,31 @@
+#!/bin/bash
+hive -e "
+SET hive.mapred.mode = nonstrict;
+WITH
+slice AS (
+SELECT *
+FROM wmf.browser_general
+WHERE
+access_method = 'desktop' AND
+CONCAT(year, '-', LPAD(month, 2, '0'), '-', LPAD(day, 2, '0'))
>= '$1' AND
+CONCAT(year, '-', LPAD(month, 2, '0'), '-', LPAD(day, 2, '0'))
< '$2'
+),
+total AS (
+SELECT SUM(view_count) as view_count_total
+FROM slice
+)
+SELECT
+'$1' AS date,
+browser_family,
+browser_major,
+SUM(view_count) / view_count_total AS percent
+FROM slice JOIN total
+GROUP BY
+'$1',
+browser_family,
+browser_major,
+view_count_total
+ORDER BY percent DESC
+LIMIT 1000
+;
+" 2> /dev/null | grep -v parquet.hadoop
diff --git a/browser/desktop_site_by_browser_family_percent
b/browser/desktop_site_by_browser_family_percent
new file mode 100755
index 000..e722d35
--- /dev/null
+++ b/browser/desktop_site_by_browser_family_percent
@@ -0,0 +1,29 @@
+#!/bin/bash
+hive -e "
+SET hive.mapred.mode = nonstrict;
+WITH
+slice AS (
+SELECT *
+FROM wmf.browser_general
+WHERE
+access_method = 'desktop' AND
+CONCAT(year, '-', LPAD(month, 2, '0'), '-', LPAD(day, 2, '0'))
>= '$1' AND
+CONCAT(year, '-', LPAD(month, 2, '0'), '-', LPAD(day, 2, '0'))
< '$2'
+),
+total AS (
+SELECT SUM(view_count) as view_count_total
+FROM slice
+)
+SELECT
+'$1' AS date,
+browser_family,
+SUM(view_count) / view_count_total AS percent
+FROM slice JOIN total
+GROUP BY
+'$1',
+browser_family,
+view_count_total
+ORDER BY percent DESC
+LIMIT 1000
+;
+" 2> /dev/null | grep -v parquet.hadoop | python $3/dynamic_pivot.py
--
To view, visit https://gerrit.wikimedia.org/r/364631
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ic4990bc1da8271247a967d6d5e0397ecaaef4816
Gerrit-PatchSet: 5
Gerrit-Project: analytics/reportupdater-queries
Gerrit-Branch: master
Gerrit-Owner: Nuria
Gerrit-Reviewer: Mforns
Gerrit-Reviewer: Milimetric
Gerrit-Reviewer: Nuria
___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits