Jdlrobson has uploaded a new change for review.
https://gerrit.wikimedia.org/r/91812
Change subject: WIP: Show monthly contributions graph
......................................................................
WIP: Show monthly contributions graph
Something is going wrong
Change-Id: I027b00a8c3df9352d4a15c01cadbabce92a207a2
---
M dashboards/reportcard.json
A datasources/monthly-contributions.json
A graphs/monthly-contributions.json
M mobile/config.yaml
A mobile/monthly-contributions.sql
5 files changed, 264 insertions(+), 11 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/analytics/limn-mobile-data
refs/changes/12/91812/1
diff --git a/dashboards/reportcard.json b/dashboards/reportcard.json
index 481d0b1..3c51a50 100644
--- a/dashboards/reportcard.json
+++ b/dashboards/reportcard.json
@@ -4,11 +4,15 @@
"subhead" : "Apps & Web",
"tabs": [
{
- "name": "Edits monthly",
+ "name": "Monthly reports",
"graph_ids": [
- "edits-monthly-unique-editors",
+ "monthly-contributions",
"edits-monthly-successful",
- "edits-monthly-5plus-editors"
+ "month-uploads",
+ "edits-monthly-unique-editors",
+ "unique-uploaders",
+ "edits-monthly-5plus-editors",
+ "deleted-uploads"
]
},
{
@@ -19,14 +23,6 @@
"successful-edits-other",
"successful-edits-unique",
"error-edits"
- ]
- },
- {
- "name": "Uploads monthly",
- "graph_ids": [
- "unique-uploaders",
- "month-uploads",
- "deleted-uploads"
]
},
{
diff --git a/datasources/monthly-contributions.json
b/datasources/monthly-contributions.json
new file mode 100644
index 0000000..fdd9d77
--- /dev/null
+++ b/datasources/monthly-contributions.json
@@ -0,0 +1,34 @@
+{
+ "name": "Monthly contributions",
+ "url":
"http://stat1001.wikimedia.org/limn-public-data/mobile/datafiles/monthly-contributions.csv",
+ "format": "csv",
+ "shortName": "monthly-contributions",
+ "type": "timeseries",
+ "id": "monthly-contributions",
+ "columns": [
+ {
+ "type": "date",
+ "label": "Month"
+ },
+ {
+ "type": "int",
+ "label": "Android photo uploads"
+ },
+ {
+ "type": "int",
+ "label": "iOS photo uploads"
+ },
+ {
+ "type": "int",
+ "label": "Web photo uploads"
+ },
+ {
+ "type": "int",
+ "label": "Web edits (main)"
+ },
+ {
+ "type": "int",
+ "label": "Web edits (other)"
+ }
+ ]
+}
diff --git a/graphs/monthly-contributions.json
b/graphs/monthly-contributions.json
new file mode 100644
index 0000000..821dfdd
--- /dev/null
+++ b/graphs/monthly-contributions.json
@@ -0,0 +1,173 @@
+{
+ "graph_version": "0.6.0",
+ "name": "Successful contributions (per month)",
+ "slug": "monthly-contributions",
+ "root": {
+ "nodeType": "canvas",
+ "minWidth": 750,
+ "minHeight": 500,
+ "height": 500,
+ "width": "auto",
+ "x": {
+ "padding": 0.001
+ },
+ "children": [
+ {
+ "disabled": false,
+ "nodeType": "axis",
+ "options": {
+ "tickFormat": "MMM YY",
+ "dimension": "x",
+ "orient": "bottom"
+ }
+ },
+ {
+ "disabled": false,
+ "nodeType": "axis",
+ "options": {
+ "tickFormat": "MMM YY",
+ "dimension": "y",
+ "orient": "left"
+ }
+ },
+ {
+ "disabled": false,
+ "nodeType": "grid",
+ "options": {
+ "ticks": 10,
+ "dimension": "x"
+ }
+ },
+ {
+ "disabled": false,
+ "nodeType": "grid",
+ "options": {
+ "ticks": 10,
+ "dimension": "y"
+ }
+ },
+ {
+ "disabled": false,
+ "nodeType": "zoom-brush",
+ "options": {
+ "allowY": true,
+ "allowX": true
+ }
+ },
+ {
+ "nodeType": "callout",
+ "target": "latest",
+ "disabled": false,
+ "steps": [
+ "1y",
+ "1M"
+ ],
+ "metricRef": 0,
+ "options": {
+ "deltaPercent": true,
+ "dateFormat": "MMM YYYY",
+ "colorDelta": true
+ }
+ },
+ {
+ "disabled": false,
+ "nodeType": "legend",
+ "options": {
+ "valueFormat": ",.2s",
+ "dateFormat": "MMM YYYY"
+ },
+ "label": "Aug 2012"
+ },
+ {
+ "disabled": false,
+ "nodeType": "bar-group",
+ "options": {
+ "palette": "wmf_projects",
+ "scale": "log",
+ "stack" : {
+ "enabled": true
+ },
+ "dateFormat": "MMM YYYY"
+ },
+ "children": [
+ {
+ "disabled": false,
+ "index": 0,
+ "metric": {
+ "source_id": "monthly-contributions",
+ "type": "int",
+ "source_col": 1
+ },
+ "nodeType": "bar",
+ "options": {
+ "label": "Edits (Main namespace)",
+ "noLegend": false,
+ "dateFormat": "MMM YYYY"
+ }
+ },
+ {
+ "disabled": false,
+ "index": 1,
+ "metric": {
+ "source_id": "monthly-contributions",
+ "type": "int",
+ "source_col": 2
+ },
+ "nodeType": "bar",
+ "options": {
+ "label": "Edit (Other namespaces)",
+ "noLegend": false,
+ "dateFormat": "MMM YYYY"
+ }
+ },
+ {
+ "disabled": false,
+ "index": 2,
+ "metric": {
+ "source_id": "",
+ "type": "int",
+ "source_col": 3
+ },
+ "nodeType": "bar",
+ "options": {
+ "label": "Android uploads",
+ "noLegend": false,
+ "dateFormat": "MMM YYYY"
+ }
+ },
+ {
+ "disabled": false,
+ "index": 3,
+ "metric": {
+ "source_id": "",
+ "type": "int",
+ "source_col": 4
+ },
+ "nodeType": "bar",
+ "options": {
+ "label": "iOS uploads",
+ "noLegend": false,
+ "dateFormat": "MMM YYYY"
+ }
+ },
+ {
+ "disabled": false,
+ "index": 4,
+ "metric": {
+ "source_id": "",
+ "type": "int",
+ "source_col": 5
+ },
+ "nodeType": "bar",
+ "options": {
+ "label": "Mobile web uploads",
+ "noLegend": false,
+ "dateFormat": "MMM YYYY"
+ }
+ }
+ ]
+ }
+ ]
+ },
+ "id": "monthly-contributions"
+}
diff --git a/mobile/config.yaml b/mobile/config.yaml
index bd54324..2e38d71 100644
--- a/mobile/config.yaml
+++ b/mobile/config.yaml
@@ -65,6 +65,8 @@
title: Successful edits (per month)
edits-monthly-5plus-editors:
title: Editors registered on mobile who made 5+ edits on
enwiki (mobile+desktop)
+ monthly-contributions:
+ title: All monthly contributions on mobile
performance-rendering:
title: Rendering time (ms)
diff --git a/mobile/monthly-contributions.sql b/mobile/monthly-contributions.sql
new file mode 100644
index 0000000..1dc0f07
--- /dev/null
+++ b/mobile/monthly-contributions.sql
@@ -0,0 +1,48 @@
+SELECT
+ Month.Date,
+ COALESCE(Edits.EditsMain, 0) AS EditsMain,
+ COALESCE(Edits.EditsOther, 0) AS EditsOther,
+ COALESCE(Apps.Android, 0) AS Android,
+ COALESCE(Apps.iOS, 0) AS iOS,
+ COALESCE(Web.Web, 0) AS Web
+
+-- http://stackoverflow.com/a/6871220/365238
+FROM (
+ SELECT DATE_FORMAT(
+ ADDDATE(CURDATE() - INTERVAL {{ intervals.running_average }} - 1 DAY,
@num:=@num+1),
+ '%Y-%m-%d'
+ ) AS Date
+ FROM {{ tables.upload_attempts }}, (SELECT @num:=-1) num LIMIT {{
intervals.running_average }}
+) AS Month
+LEFT JOIN (
+ SELECT
+ DATE(timestamp) AS Date,
+ SUM(IF( event_platform LIKE 'Android%', 1, 0)) AS Android,
+ SUM(IF( event_platform LIKE 'iOS%', 1, 0)) AS iOS
+
+ FROM {{ tables.upload_attempts }} WHERE
+ event_result = 'success' AND
+ wiki = 'commonswiki'
+ GROUP BY Date
+) AS Apps ON Month.Date = Apps.Date
+LEFT JOIN (
+ SELECT
+ DATE(timestamp) AS Date,
+ SUM(1) AS Web
+
+ FROM {{ tables.upload_web }} WHERE
+ event_action = 'success' AND
+ wiki != 'testwiki'
+ GROUP BY Date
+) AS Web ON Month.Date = Web.Date
+LEFT JOIN (
+ SELECT
+ DATE(timestamp) AS Date,
+ SUM(IF( event_namespace = 0, 1, 0)) AS EditsMain,
+ SUM(IF( event_namespace != 0, 1, 0)) AS EditsOther
+
+ FROM {{ tables.edits_web }} WHERE
+ event_action = 'success' AND
+ wiki != 'testwiki'
+ GROUP BY Date
+) AS Edits ON Month.Date = Web.Date;
--
To view, visit https://gerrit.wikimedia.org/r/91812
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I027b00a8c3df9352d4a15c01cadbabce92a207a2
Gerrit-PatchSet: 1
Gerrit-Project: analytics/limn-mobile-data
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits