[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Use WikimediaUI color palette in header

2018-01-22 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398459 )

Change subject: Use WikimediaUI color palette in header
..


Use WikimediaUI color palette in header

and increasing the contrast
See https://phabricator.wikimedia.org/M82

Change-Id: I9948ed8929430494045e1f7af389a832c981576d
---
M src/components/dashboard/DashboardArea.vue
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Looks good to me, approved
  Thiemo Kreuz (WMDE): Looks good to me, but someone else must approve



diff --git a/src/components/dashboard/DashboardArea.vue 
b/src/components/dashboard/DashboardArea.vue
index 02d9b3e..02434ef 100644
--- a/src/components/dashboard/DashboardArea.vue
+++ b/src/components/dashboard/DashboardArea.vue
@@ -31,8 +31,8 @@
 
 

[MediaWiki-commits] [Gerrit] operations/puppet[production]: Remove sensitive fields from whitelist for QuickSurvey schemas

2018-01-22 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405727 )

Change subject: Remove sensitive fields from whitelist for QuickSurvey schemas
..

Remove sensitive fields from whitelist for QuickSurvey schemas

Since EL-related work on the 2017 QuickSurvey is done, this change
removes privacy-sensitive fields from two QuickSurvey schemas:

QuickSurveyInitiation: userAgent
QuickSurveysResponses: userAgent, event_pageId, event_pageTitle

These columns still need to be nullified from the beginning of time.

Bug: T174386
Change-Id: I0c6a5ad7b652b8d802a530af81425367ee6d678f
---
M 
modules/profile/files/mariadb/misc/eventlogging/eventlogging_purging_whitelist.tsv
1 file changed, 0 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/puppet 
refs/changes/27/405727/1

diff --git 
a/modules/profile/files/mariadb/misc/eventlogging/eventlogging_purging_whitelist.tsv
 
b/modules/profile/files/mariadb/misc/eventlogging/eventlogging_purging_whitelist.tsv
index ee6e92c..07a5a3d 100644
--- 
a/modules/profile/files/mariadb/misc/eventlogging/eventlogging_purging_whitelist.tsv
+++ 
b/modules/profile/files/mariadb/misc/eventlogging/eventlogging_purging_whitelist.tsv
@@ -997,7 +997,6 @@
 MediaWikiPingback  event_database
 MediaWikiPingback  event_machine
 MediaWikiPingback  event_serverSoftware
-QuickSurveyInitiation  userAgent
 QuickSurveyInitiation  webHost
 QuickSurveyInitiation  wiki
 QuickSurveyInitiation  event_beaconCapable
@@ -1005,7 +1004,6 @@
 QuickSurveyInitiation  event_surveyCodeName
 QuickSurveyInitiation  event_surveyInstanceToken
 QuickSurveyInitiation  event_surveySessionToken
-QuickSurveysResponses  userAgent
 QuickSurveysResponses  webHost
 QuickSurveysResponses  wiki
 QuickSurveysResponses  event_countryCode
@@ -1020,8 +1018,6 @@
 QuickSurveysResponses  event_surveyResponseValue
 QuickSurveysResponses  event_surveySessionToken
 QuickSurveysResponses  event_userLanguage
-QuickSurveysResponses  event_pageId
-QuickSurveysResponses  event_pageTitle
 Kartographer   webHost
 Kartographer   wiki
 Kartographer   event_feature

-- 
To view, visit https://gerrit.wikimedia.org/r/405727
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0c6a5ad7b652b8d802a530af81425367ee6d678f
Gerrit-PatchSet: 1
Gerrit-Project: operations/puppet
Gerrit-Branch: production
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Enable top pageviews by country

2018-01-22 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/405708 )

Change subject: Enable top pageviews by country
..

Enable top pageviews by country

This change adds the top by country metric to a slot in the reading
area of the dashboard. Additionally:

- ISO lookup dictionary has been extended with missing countries
- The map's geometries have been culled from a resolution of 50m to 110m
- Name lookup has been added to the table views

Bug: T175422
Change-Id: Ia8f23c449c79dbb092b4f6fc945f2d0f768c0570
---
M src/components/dashboard/MetricListWidget.vue
M src/components/detail/chart/MapChart/MapChart.vue
M src/components/detail/chart/MapChart/isoLookup.js
M src/components/detail/chart/MapChart/world-50m.js
M src/components/detail/chart/TableChart.vue
M src/config/index.js
M src/config/metrics/reading.js
7 files changed, 283 insertions(+), 497 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/08/405708/1


-- 
To view, visit https://gerrit.wikimedia.org/r/405708
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia8f23c449c79dbb092b4f6fc945f2d0f768c0570
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Revert release 2.1.4

2018-01-16 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/404451 )

Change subject: Revert release 2.1.4
..


Revert release 2.1.4

There was a change included in the last release that made the WikiSelector
unable to choose a different wiki than the current one. The next deploy will
come with an overhaul of the selector that will fix this issue, but for now
we're reverting

Change-Id: Ibab2f03a0ca5f9f5f494c46307c339b6096b38c5
---
D dist/0.9155a7e9a34a43778291.js
M dist/index.html
D dist/main.bundle.ef2f15d9277ad60530b9.css
D dist/main.bundle.ef2f15d9277ad60530b9.js
M package.json
M src/components/TopicExplorer.vue
M src/components/WikiSelector.vue
M src/components/detail/GraphPanel.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/models/GraphModel.js
11 files changed, 21 insertions(+), 310 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/404451
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibab2f03a0ca5f9f5f494c46307c339b6096b38c5
Gerrit-PatchSet: 2
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Revert "Release 2.1.4"

2018-01-16 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404454 )

Change subject: Revert "Release 2.1.4"
..

Revert "Release 2.1.4"

There was a change included in the last release that made the WikiSelector
unable to choose a different wiki than the current one. The next deploy will
come with an overhaul of the selector that will fix this issue, but for now
we're reverting

Change-Id: Ibab2f03a0ca5f9f5f494c46307c339b6096b38c5
---
D dist/0.9155a7e9a34a43778291.js
M dist/index.html
D dist/main.bundle.ef2f15d9277ad60530b9.css
D dist/main.bundle.ef2f15d9277ad60530b9.js
M package.json
M src/components/TopicExplorer.vue
M src/components/WikiSelector.vue
M src/components/detail/GraphPanel.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/models/GraphModel.js
11 files changed, 21 insertions(+), 310 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/54/404454/1


-- 
To view, visit https://gerrit.wikimedia.org/r/404454
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibab2f03a0ca5f9f5f494c46307c339b6096b38c5
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Revert "Release 2.1.4"

2018-01-16 Thread Fdans (Code Review)
Hello jenkins-bot,

I'd like you to do a code review.  Please visit

https://gerrit.wikimedia.org/r/404451

to review the following change.


Change subject: Revert "Release 2.1.4"
..

Revert "Release 2.1.4"

This reverts commit ec4ec9828d04021463cb669f26b3665e621bf25a.

Change-Id: Ibab2f03a0ca5f9f5f494c46307c339b6096b38c5
---
D dist/0.9155a7e9a34a43778291.js
M dist/index.html
D dist/main.bundle.ef2f15d9277ad60530b9.css
D dist/main.bundle.ef2f15d9277ad60530b9.js
M package.json
M src/components/TopicExplorer.vue
M src/components/WikiSelector.vue
M src/components/detail/GraphPanel.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/models/GraphModel.js
11 files changed, 21 insertions(+), 310 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/51/404451/1


-- 
To view, visit https://gerrit.wikimedia.org/r/404451
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibab2f03a0ca5f9f5f494c46307c339b6096b38c5
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Add documentation links to each metric

2018-01-15 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402466 )

Change subject: Add documentation links to each metric
..


Add documentation links to each metric

As part of this, a new landing page has been created at
https://meta.wikimedia.org/wiki/Research:Wikistats_metrics and sub-pages
that define each metric were linked from each metric configuration.
These pages should be improved going forward, but this change fixes the
more immediate problem that right now metrics don't link anywhere.

Bug: T183188
Change-Id: Ib580427b341b104b2f47289b41a19b2dd3593fa6
---
M src/components/detail/GraphPanel.vue
M src/config/metrics/content.js
M src/config/metrics/contributing.js
M src/config/metrics/metricSchema.js
M src/config/metrics/reading.js
5 files changed, 30 insertions(+), 17 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Looks good to me, approved



diff --git a/src/components/detail/GraphPanel.vue 
b/src/components/detail/GraphPanel.vue
index 520077e..375276b 100644
--- a/src/components/detail/GraphPanel.vue
+++ b/src/components/detail/GraphPanel.vue
@@ -3,7 +3,8 @@
 
 
 
-
+
 {{graphModel.config.fullName || 'No data yet... '}}
 
 {{granularity}}
@@ -51,7 +52,12 @@
 
 {{changeOverRange}}% over this time range.
 
-{{graphModel.config.description}}. More info about this 
metric.
+{{graphModel.config.description}}.
+
+More info about this metric.
+
+
 
 
 
diff --git a/src/config/metrics/content.js b/src/config/metrics/content.js
index b4ec096..1631cef 100644
--- a/src/config/metrics/content.js
+++ b/src/config/metrics/content.js
@@ -1,8 +1,9 @@
 module.exports = {
 'absolute-bytes': {
 fullName: 'Absolute bytes diff',
-description: 'Absolute sum of all diff bytes in a project',
-question: 'How many bytes have been changed?',
+description: 'The sum of the absolute differences in bytes made by 
each edit (or revision), including edits on redirects. In other words, counting 
negative differences as positive',
+question: 'What are the total number of bytes added and removed?',
+infoUrl: 
'https://meta.wikimedia.org/wiki/Research:Wikistats_metrics/Bytes#Absolute_Bytes_Difference',
 defaults: {
 unique: {
 project: ['all-projects'],
@@ -41,8 +42,9 @@
 },
 'edited-pages': {
 fullName: 'Edited pages',
-description: 'Number of pages edited',
+description: 'The number of pages edited, excluding redirect pages',
 question: 'How many pages are edited?',
+infoUrl: 
'https://meta.wikimedia.org/wiki/Research:Wikistats_metrics/Edited_pages',
 defaults: {
 unique: {
 project: ['all-projects'],
@@ -90,8 +92,9 @@
 },
 'net-bytes': {
 fullName: 'Net bytes difference',
-description: 'Net difference between current byte size of a project 
and last period\'s',
-question: 'How did the size in bytes change since last period?',
+description: 'The sum of the differences in bytes made by each edit 
(or revision), including edits on redirects',
+question: 'How did the overall size in bytes change since last 
period?',
+infoUrl: 
'https://meta.wikimedia.org/wiki/Research:Wikistats_metrics/Bytes#Net_Bytes_Difference',
 defaults: {
 unique: {
 project: ['all-projects'],
diff --git a/src/config/metrics/contributing.js 
b/src/config/metrics/contributing.js
index 7308dea..290d339 100644
--- a/src/config/metrics/contributing.js
+++ b/src/config/metrics/contributing.js
@@ -2,8 +2,9 @@
 'editors': {
 disabled: true,
 fullName: 'Editors',
-description: 'Number of editors at a time period.',
+description: 'The count of editors with one or more edits, including 
on redirect pages',
 question: 'How many editors are there?',
+infoUrl: 
'https://meta.wikimedia.org/wiki/Research:Wikistats_metrics/Editors',
 defaults: {
 unique: {
 project: ['all-projects'],
@@ -51,8 +52,9 @@
 },
 'edits': {
 fullName: 'Edits',
-description: 'Number of wiki edits in a time period',
+description: 'The count of edits (or revisions), including edits on 
redirects',
 question: 'How many edits have been made?',
+infoUrl: 
'https://meta.wikimedia.org/wiki/Research:Wikistats_metrics/Edits',
 defaults: {
 unique: {
 project: ['all-projects'],
@@ -91,8 +93,9 @@
 'new-pages': {
 disabled: true,
 fullName: 'New pages',
- 

[MediaWiki-commits] [Gerrit] analytics/refinery[master]: Use ISO country codes instead of country names

2018-01-15 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404297 )

Change subject: Use ISO country codes instead of country names
..

Use ISO country codes instead of country names

Because using country names in the endpoint would have been unpractical
for internationalisation and machine use, we're changing the format to the
human readable letter country codes, like United States => US.

Bug: T184911
Change-Id: Iffb6412a92a3cd45b20e96be2afa03c9a01fe8c6
---
M oozie/cassandra/monthly/pageview_top_bycountry.hql
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery 
refs/changes/97/404297/1

diff --git a/oozie/cassandra/monthly/pageview_top_bycountry.hql 
b/oozie/cassandra/monthly/pageview_top_bycountry.hql
index dc38c03..a215ff2 100644
--- a/oozie/cassandra/monthly/pageview_top_bycountry.hql
+++ b/oozie/cassandra/monthly/pageview_top_bycountry.hql
@@ -36,7 +36,7 @@
 SELECT
 COALESCE(project, 'all-projects') AS project,
 COALESCE(regexp_replace(access_method, ' ', '-'), 'all-access') AS 
access,
-country_name(country_code) as country,
+country_code as country,
 LPAD(year, 4, "0") as year,
 LPAD(month, 2, "0") as month,
 SUM(view_count) as raw_views,

-- 
To view, visit https://gerrit.wikimedia.org/r/404297
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iffb6412a92a3cd45b20e96be2afa03c9a01fe8c6
Gerrit-PatchSet: 1
Gerrit-Project: analytics/refinery
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.1.4

2018-01-15 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404295 )

Change subject: Release 2.1.4
..

Release 2.1.4

Change-Id: Ibae5fb23c11b8704fae22e4879749c5638191bcd
---
A dist/0.9155a7e9a34a43778291.js
M dist/index.html
A dist/main.bundle.ef2f15d9277ad60530b9.css
A dist/main.bundle.ef2f15d9277ad60530b9.js
M package.json
M src/components/TopicExplorer.vue
M src/components/WikiSelector.vue
M src/components/detail/GraphPanel.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/models/GraphModel.js
11 files changed, 310 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/95/404295/1


-- 
To view, visit https://gerrit.wikimedia.org/r/404295
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibae5fb23c11b8704fae22e4879749c5638191bcd
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.4

2018-01-15 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/404292 )

Change subject: Release 2.1.4
..


Release 2.1.4

Change-Id: I4325000fc7423bf9cd7df4b333ffac8320a1d47e
---
A dist/0.9155a7e9a34a43778291.js
D dist/0.f749f1cd289f41b90d02.js
M dist/index.html
R dist/main.bundle.ef2f15d9277ad60530b9.css
R dist/main.bundle.ef2f15d9277ad60530b9.js
M package.json
6 files changed, 10 insertions(+), 10 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/404292
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I4325000fc7423bf9cd7df4b333ffac8320a1d47e
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.4

2018-01-15 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/404292 )

Change subject: Release 2.1.4
..

Release 2.1.4

Change-Id: I4325000fc7423bf9cd7df4b333ffac8320a1d47e
---
A dist/0.9155a7e9a34a43778291.js
D dist/0.f749f1cd289f41b90d02.js
M dist/index.html
R dist/main.bundle.ef2f15d9277ad60530b9.css
R dist/main.bundle.ef2f15d9277ad60530b9.js
M package.json
6 files changed, 10 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/92/404292/1


-- 
To view, visit https://gerrit.wikimedia.org/r/404292
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I4325000fc7423bf9cd7df4b333ffac8320a1d47e
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Replacing JSON download with CSV download

2018-01-10 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/401814 )

Change subject: Replacing JSON download with CSV download
..


Replacing JSON download with CSV download

While ticket asks to add a csv download option I think it makes sense
to have just one download option and have that be in csv format.

In order to convert seamlessly from json to csv the json data is flattened
before being passed to d3 to do the conversion.

Bug: T183192
Change-Id: I879356fd3d3f197efa51d4c16b5e27a1153e
---
M src/components/detail/GraphPanel.vue
M src/models/GraphModel.js
2 files changed, 40 insertions(+), 3 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Looks good to me, approved



diff --git a/src/components/detail/GraphPanel.vue 
b/src/components/detail/GraphPanel.vue
index 520077e..8beff48 100644
--- a/src/components/detail/GraphPanel.vue
+++ b/src/components/detail/GraphPanel.vue
@@ -78,6 +78,7 @@
 import TableChart from './chart/TableChart';
 import EmptyChart from './chart/EmptyChart';
 import StatusOverlay from '../StatusOverlay';
+import *  as d3Formatter from 'd3-dsv';
 
 export default {
 name: 'graph-panel',
@@ -152,10 +153,10 @@
 this.$emit('toggleFullscreen');
 },
 download () {
-const data = this.graphModel.graphData;
+let csvData = 
d3Formatter.csvFormat(this.graphModel.downloadData());
 let a = window.document.createElement('a');
-a.href = window.URL.createObjectURL(new 
Blob([JSON.stringify(data)], {type: 'text/json'}));
-a.download = this.graphModel.config.name + '.json';
+a.href = window.URL.createObjectURL(new Blob([csvData], {type: 
'text/csv'}));
+a.download = this.graphModel.config.name + '.csv';
 document.body.appendChild(a);
 a.click();
 document.body.removeChild(a);
diff --git a/src/models/GraphModel.js b/src/models/GraphModel.js
index dd27eb6..08180a8 100644
--- a/src/models/GraphModel.js
+++ b/src/models/GraphModel.js
@@ -53,6 +53,19 @@
 const month = createDate(ts);
 return {month: month, total: row[yAxisValue]};
 });
+
+
+}
+
+/** Data for downloading as csv needs to be a flat key/value pair object 
**/
+downloadData(){
+let jsonData = JSON.parse(JSON.stringify(this.graphData));
+// data is an array of objects that might be deeply nested (with more 
than 1 level)
+let flatJSONData = []
+_.forEach(jsonData, function(item){
+flatJSONData.push(flatten(item));
+});
+return flatJSONData;
 }
 
 refreshData () {
@@ -140,4 +153,27 @@
 }
 }
 
+/**
+* Convert an nested object in a set of flat key value pairs
+* {some: { a:1, b:2 }} will be converted to {some.a :1, some.b:2}
+**/
+function flatten(obj) {
+let accumulator = {};
+
+function _flatten(obj, keyPrefix) {
+
+ _.forEach(obj, function(value, key){
+
+if (typeof(obj[key]) === 'object'){
+_flatten(obj[key], key);
+
+} else {
+!keyPrefix ? accumulator[key] = value : accumulator[keyPrefix 
+'.'+ key] = value;
+}
+})
+}
+_flatten(obj);
+return accumulator;
+}
+
 export default GraphModel;

-- 
To view, visit https://gerrit.wikimedia.org/r/401814
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I879356fd3d3f197efa51d4c16b5e27a1153e
Gerrit-PatchSet: 7
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Nuria 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: Milimetric 
Gerrit-Reviewer: Nuria 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Translate g according to the y-axis width

2018-01-09 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/403184 )

Change subject: Translate g according to the y-axis width
..

Translate g according to the y-axis width

Before we were using a constant value, so long numbers would cut off

Bug: T184138
Change-Id: I3f8ccb260e31d7effcdb2bf03715ff50fed6a994
---
M src/components/detail/chart/BarChart.vue
1 file changed, 4 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/84/403184/1

diff --git a/src/components/detail/chart/BarChart.vue 
b/src/components/detail/chart/BarChart.vue
index 518a3fd..1487419 100644
--- a/src/components/detail/chart/BarChart.vue
+++ b/src/components/detail/chart/BarChart.vue
@@ -48,9 +48,7 @@
 root.selectAll('*').remove();
 
 const svg = root.append('svg'),
-  g = svg.append('g').attr(
-'transform', `translate(${margin.left + 
padding},${margin.top})`
-  );
+  g = svg.append('g');
 
 const n = root.node();
 const activeDict = this.graphModel.getActiveBreakdownValues();
@@ -69,6 +67,9 @@
 .style('font-size', '13px')
 .style('font-family', 'Lato, "Open Sans"');
 const yAxisContainerWidth = yAxisContainer.node().getBBox().width;
+g.attr(
+'transform', `translate(${yAxisContainerWidth},${margin.top})`
+);
 
 let width = n.offsetWidth - margin.left - margin.right - 
yAxisContainerWidth;
 let xW = scales.scaleBand()

-- 
To view, visit https://gerrit.wikimedia.org/r/403184
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I3f8ccb260e31d7effcdb2bf03715ff50fed6a994
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics...deploy[master]: Add fake data filling script for pageviews - top by country

2018-01-08 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402802 )

Change subject: Add fake data filling script for pageviews - top by country
..


Add fake data filling script for pageviews - top by country

I missed this part in the previous change. This adds a value to Cassandra
to check that the endpoint is returning the correct data with the values
given.

Change-Id: I66ae760732cf56626ba0a623e7833bf3a71dd5a1
---
M scripts/insert_monitoring_fake_data.cql
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved



diff --git a/scripts/insert_monitoring_fake_data.cql 
b/scripts/insert_monitoring_fake_data.cql
index 50bcf65..5984735 100644
--- a/scripts/insert_monitoring_fake_data.cql
+++ b/scripts/insert_monitoring_fake_data.cql
@@ -41,6 +41,17 @@
 'analytics.wikimedia.org', 'en.wikipedia', 'all-access', '1970', '01', 
'01', minTimeuuid('1970-01-01'), null, '[{"article":"-","views":0,"rank":1}]'
 );
 
+--
+-- Top by country data
+-- Test URL: 
localhost:7232/analytics.wikimedia.org/v1/pageviews/top-by-country/en.wikipedia/all-access/1970/01
+-- Expected result: 
{"items":[{"project":"en.wikipedia","access":"all-access","year":"1970","month":"01","countries":[{"country":"-","views":0,"rank":1}]}]}
+
+INSERT INTO "local_group_default_T_top_bycountry"."data" (
+  "_domain", project, access, year, month, "_tid", "_del", "countriesJSON"
+) VALUES (
+'analytics.wikimedia.org', 'en.wikipedia', 'all-access', '1970', '01', 
minTimeuuid('1970-01-01'), null, '[{"country":"-","views":0,"rank":1}]'
+);
+
 
 --
 -- Unique-devices data

-- 
To view, visit https://gerrit.wikimedia.org/r/402802
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I66ae760732cf56626ba0a623e7833bf3a71dd5a1
Gerrit-PatchSet: 2
Gerrit-Project: analytics/aqs/deploy
Gerrit-Branch: master
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: Joal 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics...deploy[master]: Add fake data filling script for pageviews - top by country

2018-01-08 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402802 )

Change subject: Add fake data filling script for pageviews - top by country
..

Add fake data filling script for pageviews - top by country

I missed this part in the previous change. This adds a value to Cassandra
to check that the endpoint is returning the correct data with the values
given.

Change-Id: I66ae760732cf56626ba0a623e7833bf3a71dd5a1
---
M scripts/insert_monitoring_fake_data.cql
1 file changed, 11 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aqs/deploy 
refs/changes/02/402802/1

diff --git a/scripts/insert_monitoring_fake_data.cql 
b/scripts/insert_monitoring_fake_data.cql
index 50bcf65..a5b8357 100644
--- a/scripts/insert_monitoring_fake_data.cql
+++ b/scripts/insert_monitoring_fake_data.cql
@@ -41,6 +41,17 @@
 'analytics.wikimedia.org', 'en.wikipedia', 'all-access', '1970', '01', 
'01', minTimeuuid('1970-01-01'), null, '[{"article":"-","views":0,"rank":1}]'
 );
 
+--
+-- Top by country data
+-- Test URL: 
localhost:7232/analytics.wikimedia.org/v1/pageviews/top-by-country/en.wikipedia/all-access/1970/01
+-- Expected result: 
{"items":[{"project":"en.wikipedia","access":"all-access","year":"1970","month":"01","countries":[{"country":"-","views":0,"rank":1}]}]}
+
+INSERT INTO "local_group_default_T_top_pageviews"."data" (
+  "_domain", project, access, year, month, "_tid", "_del", "countriesJSON"
+) VALUES (
+'analytics.wikimedia.org', 'en.wikipedia', 'all-access', '1970', '01', 
minTimeuuid('1970-01-01'), null, '[{"country":"-","views":0,"rank":1}]'
+);
+
 
 --
 -- Unique-devices data

-- 
To view, visit https://gerrit.wikimedia.org/r/402802
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I66ae760732cf56626ba0a623e7833bf3a71dd5a1
Gerrit-PatchSet: 1
Gerrit-Project: analytics/aqs/deploy
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics...deploy[master]: Update aqs to 23cb4de

2018-01-05 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/402352 )

Change subject: Update aqs to 23cb4de
..


Update aqs to 23cb4de

List of changes:
0ec14d3 Add pageviews by country endpoint
xxx Update node module dependencies

Change-Id: I1e695425e036b227638a81714f56f825931e5a13
---
A node_modules/.bin/node-pre-gyp
A node_modules/.bin/nopt
A node_modules/.bin/rc
A node_modules/abbrev/LICENSE
A node_modules/abbrev/abbrev.js
A node_modules/abbrev/package.json
M node_modules/ajv/dist/ajv.min.js
M node_modules/ajv/dist/ajv.min.js.map
M node_modules/ajv/dist/nodent.min.js
M node_modules/ajv/dist/regenerator.min.js
M node_modules/ajv/lib/ajv.d.ts
M node_modules/ajv/package.json
A node_modules/aproba/LICENSE
A node_modules/aproba/index.js
A node_modules/aproba/package.json
A node_modules/are-we-there-yet/CHANGES.md~
A node_modules/are-we-there-yet/LICENSE
A node_modules/are-we-there-yet/index.js
A node_modules/are-we-there-yet/node_modules/isarray/.npmignore
A node_modules/are-we-there-yet/node_modules/isarray/.travis.yml
A node_modules/are-we-there-yet/node_modules/isarray/Makefile
A node_modules/are-we-there-yet/node_modules/isarray/component.json
A node_modules/are-we-there-yet/node_modules/isarray/index.js
A node_modules/are-we-there-yet/node_modules/isarray/package.json
A node_modules/are-we-there-yet/node_modules/isarray/test.js
A node_modules/are-we-there-yet/node_modules/readable-stream/.npmignore
A node_modules/are-we-there-yet/node_modules/readable-stream/.travis.yml
A node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE
A node_modules/are-we-there-yet/node_modules/readable-stream/duplex-browser.js
A node_modules/are-we-there-yet/node_modules/readable-stream/duplex.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js
A node_modules/are-we-there-yet/node_modules/readable-stream/package.json
A node_modules/are-we-there-yet/node_modules/readable-stream/passthrough.js
A node_modules/are-we-there-yet/node_modules/readable-stream/readable-browser.js
A node_modules/are-we-there-yet/node_modules/readable-stream/readable.js
A node_modules/are-we-there-yet/node_modules/readable-stream/transform.js
A node_modules/are-we-there-yet/node_modules/readable-stream/writable-browser.js
A node_modules/are-we-there-yet/node_modules/readable-stream/writable.js
A node_modules/are-we-there-yet/node_modules/string_decoder/.npmignore
A node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE
A 
node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js
A node_modules/are-we-there-yet/node_modules/string_decoder/package.json
A node_modules/are-we-there-yet/package.json
A node_modules/are-we-there-yet/tracker-base.js
A node_modules/are-we-there-yet/tracker-group.js
A node_modules/are-we-there-yet/tracker-stream.js
A node_modules/are-we-there-yet/tracker.js
A node_modules/block-stream/LICENSE
A node_modules/block-stream/block-stream.js
A node_modules/block-stream/package.json
A node_modules/console-control-strings/LICENSE
A node_modules/console-control-strings/README.md~
A node_modules/console-control-strings/index.js
A node_modules/console-control-strings/package.json
M node_modules/core-js/bower.json
M node_modules/core-js/client/core.js
M node_modules/core-js/client/core.min.js
M node_modules/core-js/client/core.min.js.map
M node_modules/core-js/client/library.js
M node_modules/core-js/client/library.min.js
M node_modules/core-js/client/library.min.js.map
M node_modules/core-js/client/shim.js
M node_modules/core-js/client/shim.min.js
M node_modules/core-js/client/shim.min.js.map
M node_modules/core-js/library/modules/_core.js
M node_modules/core-js/library/modules/_iter-define.js
M node_modules/core-js/library/modules/_microtask.js
M node_modules/core-js/library/modules/_partial.js
M node_modules/core-js/library/modules/_set-collection-of.js
M node_modules/core-js/library/modules/_typed-buffer.js
A node_modules/core-js/library/modules/_user-agent.js
M node_modules/core-js/library/modules/es6.array.slice.js
M node_modules/core-js/library/modules/es6.promise.js
M node_modules/core-js/library/modules/es6.symbol.js
M 

[MediaWiki-commits] [Gerrit] analytics...deploy[master]: Update aqs to 23cb4de

2018-01-05 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/402352 )

Change subject: Update aqs to 23cb4de
..

Update aqs to 23cb4de

List of changes:
0ec14d3 Add pageviews by country endpoint
xxx Update node module dependencies

Change-Id: I1e695425e036b227638a81714f56f825931e5a13
---
A node_modules/.bin/node-pre-gyp
A node_modules/.bin/nopt
A node_modules/.bin/rc
A node_modules/abbrev/LICENSE
A node_modules/abbrev/abbrev.js
A node_modules/abbrev/package.json
M node_modules/ajv/dist/ajv.min.js
M node_modules/ajv/dist/ajv.min.js.map
M node_modules/ajv/dist/nodent.min.js
M node_modules/ajv/dist/regenerator.min.js
M node_modules/ajv/lib/ajv.d.ts
M node_modules/ajv/package.json
A node_modules/aproba/LICENSE
A node_modules/aproba/index.js
A node_modules/aproba/package.json
A node_modules/are-we-there-yet/CHANGES.md~
A node_modules/are-we-there-yet/LICENSE
A node_modules/are-we-there-yet/index.js
A node_modules/are-we-there-yet/node_modules/isarray/.npmignore
A node_modules/are-we-there-yet/node_modules/isarray/.travis.yml
A node_modules/are-we-there-yet/node_modules/isarray/Makefile
A node_modules/are-we-there-yet/node_modules/isarray/component.json
A node_modules/are-we-there-yet/node_modules/isarray/index.js
A node_modules/are-we-there-yet/node_modules/isarray/package.json
A node_modules/are-we-there-yet/node_modules/isarray/test.js
A node_modules/are-we-there-yet/node_modules/readable-stream/.npmignore
A node_modules/are-we-there-yet/node_modules/readable-stream/.travis.yml
A node_modules/are-we-there-yet/node_modules/readable-stream/LICENSE
A node_modules/are-we-there-yet/node_modules/readable-stream/duplex-browser.js
A node_modules/are-we-there-yet/node_modules/readable-stream/duplex.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_duplex.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_passthrough.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_readable.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_transform.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/_stream_writable.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/BufferList.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/destroy.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream-browser.js
A 
node_modules/are-we-there-yet/node_modules/readable-stream/lib/internal/streams/stream.js
A node_modules/are-we-there-yet/node_modules/readable-stream/package.json
A node_modules/are-we-there-yet/node_modules/readable-stream/passthrough.js
A node_modules/are-we-there-yet/node_modules/readable-stream/readable-browser.js
A node_modules/are-we-there-yet/node_modules/readable-stream/readable.js
A node_modules/are-we-there-yet/node_modules/readable-stream/transform.js
A node_modules/are-we-there-yet/node_modules/readable-stream/writable-browser.js
A node_modules/are-we-there-yet/node_modules/readable-stream/writable.js
A node_modules/are-we-there-yet/node_modules/string_decoder/.npmignore
A node_modules/are-we-there-yet/node_modules/string_decoder/LICENSE
A 
node_modules/are-we-there-yet/node_modules/string_decoder/lib/string_decoder.js
A node_modules/are-we-there-yet/node_modules/string_decoder/package.json
A node_modules/are-we-there-yet/package.json
A node_modules/are-we-there-yet/tracker-base.js
A node_modules/are-we-there-yet/tracker-group.js
A node_modules/are-we-there-yet/tracker-stream.js
A node_modules/are-we-there-yet/tracker.js
A node_modules/block-stream/LICENSE
A node_modules/block-stream/block-stream.js
A node_modules/block-stream/package.json
A node_modules/console-control-strings/LICENSE
A node_modules/console-control-strings/README.md~
A node_modules/console-control-strings/index.js
A node_modules/console-control-strings/package.json
M node_modules/core-js/bower.json
M node_modules/core-js/client/core.js
M node_modules/core-js/client/core.min.js
M node_modules/core-js/client/core.min.js.map
M node_modules/core-js/client/library.js
M node_modules/core-js/client/library.min.js
M node_modules/core-js/client/library.min.js.map
M node_modules/core-js/client/shim.js
M node_modules/core-js/client/shim.min.js
M node_modules/core-js/client/shim.min.js.map
M node_modules/core-js/library/modules/_core.js
M node_modules/core-js/library/modules/_iter-define.js
M node_modules/core-js/library/modules/_microtask.js
M node_modules/core-js/library/modules/_partial.js
M node_modules/core-js/library/modules/_set-collection-of.js
M node_modules/core-js/library/modules/_typed-buffer.js
A node_modules/core-js/library/modules/_user-agent.js
M node_modules/core-js/library/modules/es6.array.slice.js
M node_modules/core-js/library/modules/es6.promise.js
M node_modules/core-js/library/modules/es6.symbol.js
M 

[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.1.3

2017-12-21 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/399642 )

Change subject: Release 2.1.3
..


Release 2.1.3

Change-Id: I2ad974d53fe29d9f3001b013119419e4f7bad454
---
A dist/0.f749f1cd289f41b90d02.js
M dist/index.html
A dist/main.bundle.d109dc234154042407c3.css
A dist/main.bundle.d109dc234154042407c3.js
M package.json
M src/App.vue
M src/components/RouterLink.vue
M src/components/TopNav.vue
M src/components/detail/chart/BarChart.vue
9 files changed, 291 insertions(+), 10 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/399642
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I2ad974d53fe29d9f3001b013119419e4f7bad454
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.1.3

2017-12-21 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399642 )

Change subject: Release 2.1.3
..

Release 2.1.3

Change-Id: I2ad974d53fe29d9f3001b013119419e4f7bad454
---
A dist/0.f749f1cd289f41b90d02.js
M dist/index.html
A dist/main.bundle.d109dc234154042407c3.css
A dist/main.bundle.d109dc234154042407c3.js
M package.json
M src/App.vue
M src/components/RouterLink.vue
M src/components/TopNav.vue
M src/components/detail/chart/BarChart.vue
9 files changed, 291 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/42/399642/1


-- 
To view, visit https://gerrit.wikimedia.org/r/399642
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I2ad974d53fe29d9f3001b013119419e4f7bad454
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.3

2017-12-21 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399641 )

Change subject: Release 2.1.3
..

Release 2.1.3

Change-Id: I8f318f3a87fa84e60cebda7790b4056149a21fe7
---
A dist/0.f749f1cd289f41b90d02.js
M dist/index.html
A dist/main.bundle.d109dc234154042407c3.css
A dist/main.bundle.d109dc234154042407c3.js
M package.json
M src/App.vue
M src/components/RouterLink.vue
M src/components/TopNav.vue
M src/components/detail/chart/BarChart.vue
9 files changed, 291 insertions(+), 10 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/41/399641/1


-- 
To view, visit https://gerrit.wikimedia.org/r/399641
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I8f318f3a87fa84e60cebda7790b4056149a21fe7
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.3

2017-12-21 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/399639 )

Change subject: Release 2.1.3
..


Release 2.1.3

Change-Id: Ibe36118b5b84ce0f1eb07ba1c20315e55484c111
---
R dist/0.f749f1cd289f41b90d02.js
M dist/index.html
D dist/main.bundle.6aa45af5f7c261621b32.js
R dist/main.bundle.d109dc234154042407c3.css
A dist/main.bundle.d109dc234154042407c3.js
M package.json
6 files changed, 51 insertions(+), 51 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/399639
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ibe36118b5b84ce0f1eb07ba1c20315e55484c111
Gerrit-PatchSet: 2
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.3

2017-12-21 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/399639 )

Change subject: Release 2.1.3
..

Release 2.1.3

Change-Id: Ibe36118b5b84ce0f1eb07ba1c20315e55484c111
---
D dist/0.180389ff89e7c818b95c.js
M dist/index.html
D dist/main.bundle.6aa45af5f7c261621b32.css
D dist/main.bundle.6aa45af5f7c261621b32.js
M package.json
5 files changed, 3 insertions(+), 252 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/39/399639/1


-- 
To view, visit https://gerrit.wikimedia.org/r/399639
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ibe36118b5b84ce0f1eb07ba1c20315e55484c111
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Fix width of axis

2017-12-21 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/399438 )

Change subject: Fix width of axis
..


Fix width of axis

Bug: T182817
Change-Id: I995e088c4f2f9fee67ad5223a3c95d4fdf8eeb0f
---
M src/components/detail/chart/BarChart.vue
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Looks good to me, approved



diff --git a/src/components/detail/chart/BarChart.vue 
b/src/components/detail/chart/BarChart.vue
index 03a3727..518a3fd 100644
--- a/src/components/detail/chart/BarChart.vue
+++ b/src/components/detail/chart/BarChart.vue
@@ -122,7 +122,7 @@
 .style('stroke-width', 0.5);
 }
 const x = scales.scaleTime()
-  .rangeRound([0, graphElement.node().getBBox().width])
+  .rangeRound([0, width])
   .domain(datespan);
 const xAxis = axes.axisBottom(x);
 g.append('g').attr('transform', `translate(0,${height})`)

-- 
To view, visit https://gerrit.wikimedia.org/r/399438
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I995e088c4f2f9fee67ad5223a3c95d4fdf8eeb0f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Milimetric 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Add link path to router-link

2017-12-19 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398854 )

Change subject: Add link path to router-link
..


Add link path to router-link

Router-links do not show the path they will navigate to when clicked.
However, for navigation clarity, and also to be able to open links in
another tab, the link path is useful. This change adds it.

Test plan:
- Hover over router-links and check the browser shows the full path.
- Click on router-links and check the browser does only xhr.
- Ctrl+click / Command+click on router-links and check links are
  opened in new tabs regularly.

Bug: T183149
Change-Id: Id2f6b81603b730c6ff01312eed592ca6fc326490
---
M src/components/RouterLink.vue
M src/components/TopNav.vue
2 files changed, 20 insertions(+), 4 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Verified; Looks good to me, approved



diff --git a/src/components/RouterLink.vue b/src/components/RouterLink.vue
index f581ec3..5db600f 100644
--- a/src/components/RouterLink.vue
+++ b/src/components/RouterLink.vue
@@ -1,5 +1,5 @@
 
-
+
 
 
 
@@ -13,9 +13,22 @@
 to: { type: Object, default: '' },
 },
 methods: {
-commitState () {
-if (!this.isCurrent()) {
-this.$store.commit('resetNavigationState', this.to);
+linkPath () {
+// Note that href="linkPath()" is not used by the browser for 
regular clicks.
+// The browser will only use it when opening links in a new tab, 
and also as
+// a visual reference for the user when they hover the cursor over 
a link.
+let root = window.location.pathname;
+let redirectedState = router.getRedirectedState(this.to, routes) 
|| this.to;
+return router.getPathFromState(root, redirectedState, routes);
+},
+commitState (event) {
+// If the user tries to open a link in a new tab, let the browser 
handle that.
+// Otherwise, prevent the default request and navigate by directly 
changing the state.
+if (!event.ctrlKey && !event.metaKey) {
+event.preventDefault();
+if (!this.isCurrent()) {
+this.$store.commit('resetNavigationState', this.to);
+}
 }
 },
 highlightClass () {
diff --git a/src/components/TopNav.vue b/src/components/TopNav.vue
index 406e1c0..3296661 100644
--- a/src/components/TopNav.vue
+++ b/src/components/TopNav.vue
@@ -60,4 +60,7 @@
 .router-link-current {
 cursor: default;
 }
+.router-link-not-current {
+color: #3366cc;
+}
 

-- 
To view, visit https://gerrit.wikimedia.org/r/398854
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Id2f6b81603b730c6ff01312eed592ca6fc326490
Gerrit-PatchSet: 5
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Mforns 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: Mforns 
Gerrit-Reviewer: Milimetric 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.1.2

2017-12-14 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398322 )

Change subject: Release 2.1.2
..


Release 2.1.2

Change-Id: I7fcd8475561bb41264b36c4b53a7a6b91217e5ae
---
M .babelrc
A dist/0.180389ff89e7c818b95c.js
M dist/index.html
A dist/main.bundle.6aa45af5f7c261621b32.css
A dist/main.bundle.6aa45af5f7c261621b32.js
M package.json
M src/App.vue
M src/apis/aqs.js
M src/components/dashboard/MetricListWidget.vue
M src/components/dashboard/MetricWidget.vue
M src/components/detail/Detail.vue
M src/components/detail/GraphPanel.vue
M src/config/index.js
M src/config/metrics/content.js
M src/config/metrics/contributing.js
M src/config/metrics/metricSchema.js
M src/config/metrics/reading.js
M src/utils.js
M webpack/base.config.js
M webpack/dev.config.js
M webpack/prod.config.js
21 files changed, 332 insertions(+), 21 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/398322
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7fcd8475561bb41264b36c4b53a7a6b91217e5ae
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.1.2

2017-12-14 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398322 )

Change subject: Release 2.1.2
..

Release 2.1.2

Change-Id: I7fcd8475561bb41264b36c4b53a7a6b91217e5ae
---
M .babelrc
A dist/0.180389ff89e7c818b95c.js
M dist/index.html
A dist/main.bundle.6aa45af5f7c261621b32.css
A dist/main.bundle.6aa45af5f7c261621b32.js
M package.json
M src/App.vue
M src/apis/aqs.js
M src/components/dashboard/MetricListWidget.vue
M src/components/dashboard/MetricWidget.vue
M src/components/detail/Detail.vue
M src/components/detail/GraphPanel.vue
M src/config/index.js
M src/config/metrics/content.js
M src/config/metrics/contributing.js
M src/config/metrics/metricSchema.js
M src/config/metrics/reading.js
M src/utils.js
M webpack/base.config.js
M webpack/dev.config.js
M webpack/prod.config.js
21 files changed, 332 insertions(+), 21 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/22/398322/1


-- 
To view, visit https://gerrit.wikimedia.org/r/398322
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7fcd8475561bb41264b36c4b53a7a6b91217e5ae
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.2

2017-12-14 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398321 )

Change subject: Release 2.1.2
..


Release 2.1.2

Change-Id: I0e36948f9ae3487a2baccaa486ead21e2766dce0
---
A dist/0.180389ff89e7c818b95c.js
M dist/index.html
R dist/main.bundle.6aa45af5f7c261621b32.css
A dist/main.bundle.6aa45af5f7c261621b32.js
D dist/main.bundle.751226286aee5a85cd6d.js
M package.json
M src/components/dashboard/MetricListWidget.vue
7 files changed, 52 insertions(+), 51 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/398321
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0e36948f9ae3487a2baccaa486ead21e2766dce0
Gerrit-PatchSet: 2
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.2

2017-12-14 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398321 )

Change subject: Release 2.1.2
..

Release 2.1.2

Change-Id: I0e36948f9ae3487a2baccaa486ead21e2766dce0
---
A dist/0.180389ff89e7c818b95c.js
M dist/index.html
D dist/main.bundle.751226286aee5a85cd6d.js
R dist/main.bundle.b9f13db89dd0aec36856.css
A dist/main.bundle.b9f13db89dd0aec36856.js
M package.json
M src/components/dashboard/MetricListWidget.vue
7 files changed, 52 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/21/398321/1


-- 
To view, visit https://gerrit.wikimedia.org/r/398321
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0e36948f9ae3487a2baccaa486ead21e2766dce0
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Replaces hardcoded URL with dynamic date values

2017-12-14 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398306 )

Change subject: Replaces hardcoded URL with dynamic date values
..


Replaces hardcoded URL with dynamic date values

For now it disables the time range selector on top metrics, pending
the addition to the detail page of a month/year picker.

Bug: T182859

Change-Id: I5ec7db40147c705ecc028ffaac644fa525457170
---
M src/apis/aqs.js
M src/components/dashboard/MetricWidget.vue
M src/components/detail/Detail.vue
M src/components/detail/GraphPanel.vue
M src/config/index.js
M src/config/metrics/content.js
M src/config/metrics/contributing.js
M src/config/metrics/metricSchema.js
M src/config/metrics/reading.js
M src/utils.js
10 files changed, 56 insertions(+), 8 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Looks good to me, approved



diff --git a/src/apis/aqs.js b/src/apis/aqs.js
index a7261ff..50ec152 100644
--- a/src/apis/aqs.js
+++ b/src/apis/aqs.js
@@ -50,6 +50,7 @@
 .map(p => Object.assign(p, commonParameters))
 .map(p => {
 let url = apiConfig.endpoint;
+
 url.match(/{{.*?}}/g)
 .forEach((k) => {
 const key = _.trim(k, '{}');
@@ -69,7 +70,6 @@
 });
 });
 });
-const metricData = config.metricData(commonParameters.metric);
 return Promise.all(promises).then(data => {
 let validData = _.filter(data, d => !d.hasOwnProperty('error'));
 let formattedData = _.flatten(validData.map(d => d.items));
@@ -79,7 +79,7 @@
 if (formattedData[0].results) {
 formattedData = this.transformResults(formattedData);
 }
-if (metricData.type === 'list') {
+if (commonParameters.structure === 'top') {
 formattedData = this.formatTops(formattedData);
 }
 return new DimensionalData(formattedData);
@@ -126,5 +126,12 @@
 }, []);
 }
 }
+/*
+
+AQS only has data up to the previous month to the current, so when requesting
+the last data available we should check that we're not trying to get
+the current month (or later).
+
+*/
 
 export default AQS;
diff --git a/src/components/dashboard/MetricWidget.vue 
b/src/components/dashboard/MetricWidget.vue
index 4437531..da0cf09 100644
--- a/src/components/dashboard/MetricWidget.vue
+++ b/src/components/dashboard/MetricWidget.vue
@@ -76,6 +76,7 @@
 
 import AQS from '../../apis/aqs';
 import config from '../../config';
+import utils from '../../utils';
 import GraphModel from '../../models/GraphModel';
 import RouterLink from '../RouterLink';
 
@@ -229,10 +230,15 @@
 {
 start: params.range[0],
 end: params.range[1],
-granularity: params.granularity
+granularity: params.granularity,
+structure: params.metricConfig.structure,
 }
 );
 
+if (params.metricConfig.structure === 'top') {
+Object.assign(commonParameters, 
utils.getLastFullMonth(commonParameters.end));
+}
+
 let dataPromise = this.aqsApi.getData(uniqueParameters, 
commonParameters);
 this.overlayMessage = StatusOverlay.LOADING;
 
diff --git a/src/components/detail/Detail.vue b/src/components/detail/Detail.vue
index c52f858..7959519 100644
--- a/src/components/detail/Detail.vue
+++ b/src/components/detail/Detail.vue
@@ -29,6 +29,7 @@
 import TimeRangeSelector from '../TimeRangeSelector';
 
 import config from '../../config';
+import utils from '../../utils';
 
 import GraphModel from '../../models/GraphModel';
 import AQS from '../../apis/aqs';
@@ -148,10 +149,15 @@
 {
 start: params.range[0],
 end: params.range[1],
-granularity: params.granularity
+granularity: params.granularity,
+structure: params.metricConfig.structure,
 }
 );
 
+if (params.metricConfig.structure === 'top') {
+Object.assign(commonParameters, 
utils.getLastFullMonth(commonParameters.end));
+}
+
 if (params.breakdown && !params.breakdown.total) {
 let breakdownKeys = params.breakdown.values.filter(bv => 
bv.on).map(bv => bv.key);
 
diff --git a/src/components/detail/GraphPanel.vue 
b/src/components/detail/GraphPanel.vue
index a90a810..520077e 100644
--- a/src/components/detail/GraphPanel.vue
+++ b/src/components/detail/GraphPanel.vue
@@ -54,7 +54,7 @@
 {{graphModel.config.description}}. More info about this 
metric.
 
 
-
+
 
 
 

[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Replaces hardcoded URL with dynamic date values

2017-12-14 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398306 )

Change subject: Replaces hardcoded URL with dynamic date values
..

Replaces hardcoded URL with dynamic date values

For now it disables the time range selector on top metrics, pending
the addition to the detail page of a month/year picker.

Bug: T182859

Change-Id: I5ec7db40147c705ecc028ffaac644fa525457170
---
M src/apis/aqs.js
M src/components/detail/GraphPanel.vue
M src/config/index.js
M src/config/metrics/content.js
M src/config/metrics/contributing.js
M src/config/metrics/metricSchema.js
M src/config/metrics/reading.js
7 files changed, 43 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/06/398306/1

diff --git a/src/apis/aqs.js b/src/apis/aqs.js
index a7261ff..1c53f01 100644
--- a/src/apis/aqs.js
+++ b/src/apis/aqs.js
@@ -44,12 +44,21 @@
 if (!commonParameters.metric) {
 return new Promise(() => new DimensionalData());
 }
+const metricData = config.metricData(commonParameters.metric);
 
 let apiConfig = config.aqs[commonParameters.metric];
 let promises = utils.labeledCrossProduct(uniqueParameters)
 .map(p => Object.assign(p, commonParameters))
 .map(p => {
 let url = apiConfig.endpoint;
+if (metricData.structure === 'top') {
+// Tops metrics don't use a range, but a concrete date, 
which we need
+// to extract from the date.
+const date = getTopsDateFromRange(commonParameters.end);
+p.month = '' + (date.getMonth() + 1);
+(p.month.length === 1) && (p.month = '0' + p.month);
+p.year = date.getFullYear();
+}
 url.match(/{{.*?}}/g)
 .forEach((k) => {
 const key = _.trim(k, '{}');
@@ -69,7 +78,6 @@
 });
 });
 });
-const metricData = config.metricData(commonParameters.metric);
 return Promise.all(promises).then(data => {
 let validData = _.filter(data, d => !d.hasOwnProperty('error'));
 let formattedData = _.flatten(validData.map(d => d.items));
@@ -126,5 +134,22 @@
 }, []);
 }
 }
+/*
+
+AQS only has data up to the previous month to the current, so when requesting
+the last data available we should check that we're not trying to get
+the current month (or later).
+
+*/
+function getTopsDateFromRange (endOfRange) {
+const year = endOfRange.slice(0,4);
+const month = endOfRange.slice(4,6);
+const day = endOfRange.slice(6,8);
+let aMonthAgo = new Date();
+aMonthAgo.setDate(1);
+aMonthAgo.setHours(-1);
+let date = new Date(year +'-'+month+'-'+day);
+return new Date(Math.min(date, aMonthAgo));
+}
 
 export default AQS;
diff --git a/src/components/detail/GraphPanel.vue 
b/src/components/detail/GraphPanel.vue
index a90a810..520077e 100644
--- a/src/components/detail/GraphPanel.vue
+++ b/src/components/detail/GraphPanel.vue
@@ -54,7 +54,7 @@
 {{graphModel.config.description}}. More info about this 
metric.
 
 
-
+
 
 
 
diff --git a/src/config/index.js b/src/config/index.js
index df55ea3..13eab16 100644
--- a/src/config/index.js
+++ b/src/config/index.js
@@ -148,7 +148,7 @@
 },
 
 'top-viewed-articles': {
-endpoint: AQS_HOST + 
'/pageviews/top/{{project}}/{{access}}/2015/10/all-days'
+endpoint: AQS_HOST + 
'/pageviews/top/{{project}}/{{access}}/{{year}}/{{month}}/all-days'
 },
 
 'new-pages': {
diff --git a/src/config/metrics/content.js b/src/config/metrics/content.js
index 686a187..b4ec096 100644
--- a/src/config/metrics/content.js
+++ b/src/config/metrics/content.js
@@ -15,6 +15,7 @@
 }
 },
 type: 'bars',
+structure: 'timeseries',
 area: 'content',
 value: 'abs_bytes_diff',
 unit: 'bytes',
@@ -55,6 +56,7 @@
 }
 },
 type: 'lines',
+structure: 'timeseries',
 area: 'content',
 value: 'edited_pages',
 global: false,
@@ -102,6 +104,7 @@
 }
 },
 type: 'bars',
+structure: 'timeseries',
 area: 'content',
 unit: 'bytes',
 value: 'net_bytes_diff',
diff --git a/src/config/metrics/contributing.js 
b/src/config/metrics/contributing.js
index 8476969..7308dea 100644
--- a/src/config/metrics/contributing.js
+++ b/src/config/metrics/contributing.js
@@ -17,6 +17,7 @@
 }
 },
 type: 'lines',
+structure: 'timeseries',
 area: 'contributing',
 value: 'editors',
 global: false,
@@ -64,6 +65,7 @@
 }
 },
   

[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.1.1

2017-12-13 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398100 )

Change subject: Release 2.1.1
..

Release 2.1.1

Change-Id: I6a6dcae568fa215c10a47489da9ac45df4a4b26f
---
A .gitreview
M dist/index.html
A dist/main.bundle.751226286aee5a85cd6d.css
A dist/main.bundle.751226286aee5a85cd6d.js
M package.json
M src/components/WikiSelector.vue
M src/components/dashboard/MetricWidget.vue
M src/components/detail/Breakdowns.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/models/GraphModel.js
M test/components/LineChart.spec.js
12 files changed, 321 insertions(+), 85 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/00/398100/1


-- 
To view, visit https://gerrit.wikimedia.org/r/398100
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6a6dcae568fa215c10a47489da9ac45df4a4b26f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.1

2017-12-13 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398097 )

Change subject: Release 2.1.1
..


Release 2.1.1

Change-Id: I256d189719e4be585cf657d8379891682615e63d
---
M dist/index.html
D dist/main.bundle.3bcc116d6d7b4625210b.css
D dist/main.bundle.3bcc116d6d7b4625210b.js
R dist/main.bundle.751226286aee5a85cd6d.css
A dist/main.bundle.751226286aee5a85cd6d.js
D dist/main.bundle.c4603511208e0d6eb76a.js
M package.json
7 files changed, 50 insertions(+), 289 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/398097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I256d189719e4be585cf657d8379891682615e63d
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.1.1

2017-12-13 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/398100 )

Change subject: Release 2.1.1
..


Release 2.1.1

Change-Id: I6a6dcae568fa215c10a47489da9ac45df4a4b26f
---
A .gitreview
M dist/index.html
A dist/main.bundle.751226286aee5a85cd6d.css
A dist/main.bundle.751226286aee5a85cd6d.js
M package.json
M src/components/WikiSelector.vue
M src/components/dashboard/MetricWidget.vue
M src/components/detail/Breakdowns.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/models/GraphModel.js
M test/components/LineChart.spec.js
12 files changed, 321 insertions(+), 85 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/398100
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6a6dcae568fa215c10a47489da9ac45df4a4b26f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.1.1

2017-12-13 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398097 )

Change subject: Release 2.1.1
..

Release 2.1.1

Change-Id: I256d189719e4be585cf657d8379891682615e63d
---
M dist/index.html
D dist/main.bundle.3bcc116d6d7b4625210b.css
D dist/main.bundle.3bcc116d6d7b4625210b.js
R dist/main.bundle.751226286aee5a85cd6d.css
A dist/main.bundle.751226286aee5a85cd6d.js
D dist/main.bundle.c4603511208e0d6eb76a.js
M package.json
7 files changed, 50 insertions(+), 289 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/97/398097/1


-- 
To view, visit https://gerrit.wikimedia.org/r/398097
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I256d189719e4be585cf657d8379891682615e63d
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Fix infinite loop

2017-12-13 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/397995 )

Change subject: Fix infinite loop
..


Fix infinite loop

For the future, the flow of events and data in WikiSelector is too
circular.  The init calls get triggered when they're not necessary,
after state changes.

Also, the way the hidden div is added with an id is not great, that
should at least have a class and in general should be added relative to
the component in case multiple versions of the same component are used
on the page.

Bug: T182700
Change-Id: I1dd5f4bce62caaf14215b4fa158d030f53e8f084
---
M src/components/WikiSelector.vue
1 file changed, 18 insertions(+), 9 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Verified; Looks good to me, approved



diff --git a/src/components/WikiSelector.vue b/src/components/WikiSelector.vue
index c317788..bf8c50d 100644
--- a/src/components/WikiSelector.vue
+++ b/src/components/WikiSelector.vue
@@ -31,6 +31,8 @@
 
 
 

[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Fix usage of _.sortBy in tops function

2017-12-13 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/398049 )

Change subject: Fix usage of _.sortBy in tops function
..

Fix usage of _.sortBy in tops function

We're currently using a string as an accessor to the _.sortBy lodash
function, which means the list of results is not being sorted as expected.
Using a function as accessor fixes the problem.

Bug: T182772
Change-Id: Iccc35e726201729b152c9abc9c3e0a769964ebea
---
M src/models/GraphModel.js
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/49/398049/1

diff --git a/src/models/GraphModel.js b/src/models/GraphModel.js
index 5d9fc70..dd27eb6 100644
--- a/src/models/GraphModel.js
+++ b/src/models/GraphModel.js
@@ -38,7 +38,7 @@
 setData (data) {
 this.data = data;
 
-if (this.config.type === 'list') {
+if (['list', 'map'].includes(this.config.type)) {
 this.graphData = this.topXByY();
 return;
 }
@@ -118,7 +118,7 @@
 
 this.data.measure(x);
 const results = this.data.breakdown(y);
-return _.take(_.sortBy(results, y).reverse(), limit || results.length);
+return _.take(_.sortBy(results, (row) => row[y].total).reverse(), 
limit || results.length);
 }
 
 formatNumberForMetric (number) {

-- 
To view, visit https://gerrit.wikimedia.org/r/398049
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iccc35e726201729b152c9abc9c3e0a769964ebea
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Fix bar chart not re-rendering

2017-12-12 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/396537 )

Change subject: Fix bar chart not re-rendering
..


Fix bar chart not re-rendering

When the table chart was selected on a bar-chart metric detail page, and
the user switched back to the bar chart, the lack of a mounted hook
meant the chart was not drawn.

Bug: T182461
Change-Id: I7047ec310beb912699b00f332eb6565251ebb46f
---
M src/components/detail/chart/BarChart.vue
1 file changed, 4 insertions(+), 0 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved



diff --git a/src/components/detail/chart/BarChart.vue 
b/src/components/detail/chart/BarChart.vue
index 5af18c5..08c72c7 100644
--- a/src/components/detail/chart/BarChart.vue
+++ b/src/components/detail/chart/BarChart.vue
@@ -19,6 +19,10 @@
 name: 'bar-chart',
 props: ['graphModel', 'data'],
 
+mounted () {
+this.drawChart();
+},
+
 watch: {
 data: function () {
 this.drawChart();

-- 
To view, visit https://gerrit.wikimedia.org/r/396537
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I7047ec310beb912699b00f332eb6565251ebb46f
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Milimetric 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Fix loading sparse data into widgets

2017-12-12 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/396469 )

Change subject: Fix loading sparse data into widgets
..


Fix loading sparse data into widgets

When data isn't continuous, widgets behave in hard-to-predict ways like
showing NaNs and incorrect YoY or MoM totals.  This patch addresses most
of that but I'm not really sure what to do when there's data *more* than
a year ago.  The change from the last available datapoint beyond a year
seems relevant, but it's not YoY change.

Bug: T182224
Change-Id: If911e6dceeb9281887e19e705ae716c1ea1b6772
---
M src/components/dashboard/MetricWidget.vue
1 file changed, 38 insertions(+), 6 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved



diff --git a/src/components/dashboard/MetricWidget.vue 
b/src/components/dashboard/MetricWidget.vue
index 7e3e986..4437531 100644
--- a/src/components/dashboard/MetricWidget.vue
+++ b/src/components/dashboard/MetricWidget.vue
@@ -18,8 +18,13 @@
 
 {{getMonthValue(lastMonth.month)}}
 
-
-{{changeMoM}} % month over month
+
+
+{{changeMoM}} % month over month
+
+
+(no data last month)
+
 
 
 
 
 
-
+
 
{{graphModel.formatNumberForMetric(lastYearAggregation)}}
 
-
+
 
 {{changeYoY}} % year over year
 
 
 
-Year {{aggregationType}} 
({{monthOneYearAgo.month.getFullYear()}})
+
+Year {{aggregationType}} 
({{monthOneYearAgo.month.getFullYear()}})
+{{aggregationType}} (all available 
data)
+
+
+(no data last year)
+
 
 
 
@@ -123,7 +134,16 @@
 monthOneYearAgo: function () {
 if (!this.lastMonth) { return null; }
 
-return this.graphData[_.indexOf(this.graphData, 
this.lastMonth) - 12];
+let last = _.indexOf(this.graphData, this.lastMonth);
+const lastMonth = this.graphData[last].month;
+
+while (last > 0) {
+last--;
+if (lastMonth - this.graphData[last].month >= 3153600) 
{
+return this.graphData[last];
+}
+}
+return null;
 },
 lastYearAggregation: function () {
 return this.graphModel.getLimitedAggregate(12);
@@ -136,12 +156,24 @@
 
 const data = this.graphData;
 const prev = data[data.length - 2];
+
+if (!prev
+|| !prev.total
+|| this.lastMonth.month - prev.month > 276480) {
+return null;
+}
+
 const diff = this.lastMonth.total - prev.total;
 return ((diff / prev.total) * 100).toFixed(2);
 },
 changeYoY: function () {
 // TODO: We're showing more than the last year, but reporting 
YoY.  This can be confusing because the YoY might not match up visually with 
the graph (like for Unique Devices in Achinese).
 
+if (!this.monthOneYearAgo
+|| !this.monthOneYearAgo.total) {
+return null;
+}
+
 const diff = this.lastMonth.total - this.monthOneYearAgo.total;
 return ((diff / this.monthOneYearAgo.total) * 100).toFixed(2);
 },

-- 
To view, visit https://gerrit.wikimedia.org/r/396469
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: If911e6dceeb9281887e19e705ae716c1ea1b6772
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Milimetric 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: build: drop PhantomJS, use Chrome/Firefox

2017-12-11 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/395537 )

Change subject: build: drop PhantomJS, use Chrome/Firefox
..


build: drop PhantomJS, use Chrome/Firefox

'npm test' runs PhantomJS which uses the Webkit engine. It is quite
outdated and offer little speed benefits compared to Chrome or Firefox.

Switch 'npm test' to run Karma with Chrome and Firefox.
Add karma-firefox-launcher
Remove karma-phantomjs-launcher

Wikimedia Jenkins will run it as:

CHROME_BIN=/usr/bin/chromium npm test

Result:
Chrome 62.0.3202: Executed 71 of 71 SUCCESS (0.242 secs / 0.296 secs)
Firefox 52.0.0: Executed 71 of 71 SUCCESS (0.491 secs / 0.546 secs)

'npm testDev' is left untouched and still runs whatever browser is
defined in karma.conf (which is 'Chrome').

Change-Id: Idb02dd8afb1b2f20f7affb1e67fbf8b8d37700d7
---
M package.json
1 file changed, 2 insertions(+), 2 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Verified; Looks good to me, approved



diff --git a/package.json b/package.json
index d608024..9138996 100644
--- a/package.json
+++ b/package.json
@@ -4,7 +4,7 @@
 "description": "A front end for Wikimedia project statistics.  This is a 
new version implemented with Vue and Semantic UI.",
 "main": "index.js",
 "scripts": {
-"test": "./node_modules/karma/bin/karma start --single-run --browsers 
PhantomJS",
+"test": "./node_modules/karma/bin/karma start --single-run --browsers 
Chrome,Firefox",
 "testDev": "./node_modules/karma/bin/karma start",
 "build": "./node_modules/webpack/bin/webpack.js --config 
webpack/prod.config.js",
 "start": "NODE_ENV=development webpack-dev-server --config 
webpack/dev.config.js",
@@ -39,9 +39,9 @@
 "jasmine-core": "^2.6.2",
 "karma": "^1.7.0",
 "karma-chrome-launcher": "^2.1.1",
+"karma-firefox-launcher": "^1.0.1",
 "karma-jasmine": "^1.1.0",
 "karma-jasmine-ajax": "^0.1.13",
-"karma-phantomjs-launcher": "^1.0.4",
 "karma-webpack": "^2.0.3",
 "style-loader": "^0.18.1",
 "string-replace-loader": "^1.3.0",

-- 
To view, visit https://gerrit.wikimedia.org/r/395537
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Idb02dd8afb1b2f20f7affb1e67fbf8b8d37700d7
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: Hashar 
Gerrit-Reviewer: Jdrewniak 
Gerrit-Reviewer: Milimetric 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Add .gitreview

2017-12-11 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/395536 )

Change subject: Add .gitreview
..


Add .gitreview

Change-Id: I68b95e048df1a9acf73b3931029fd91e2d96673c
---
A .gitreview
1 file changed, 6 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Looks good to me, approved



diff --git a/.gitreview b/.gitreview
new file mode 100644
index 000..5c48640
--- /dev/null
+++ b/.gitreview
@@ -0,0 +1,6 @@
+[gerrit]
+host=gerrit.wikimedia.org
+port=29418
+project=analytics/wikistats2.git
+track=1
+defaultrebase=0

-- 
To view, visit https://gerrit.wikimedia.org/r/395536
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I68b95e048df1a9acf73b3931029fd91e2d96673c
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Hashar 
Gerrit-Reviewer: Fdans 
Gerrit-Reviewer: Milimetric 
Gerrit-Reviewer: jenkins-bot <>

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/refinery[master]: [wip] Add pageview by country oozie jobs

2017-11-29 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/394062 )

Change subject: [wip] Add pageview by country oozie jobs
..

[wip] Add pageview by country oozie jobs

Adds coordinators and hive scripts necessary to load pageviews by country
data into cassandra.

Bug: T181521
Change-Id: I35b7736c07c5f2346cecf6c388dd252632aab88c
---
M oozie/cassandra/bundle.xml
A oozie/cassandra/coord_pageviews_bycountry_daily.properties
A oozie/cassandra/coord_pageviews_bycountry_monthly.properties
M oozie/cassandra/coord_top_articles_daily.properties
A oozie/cassandra/daily/pageview_top_bycountry.hql
A oozie/cassandra/monthly/pageview_top_bycountry.sql
6 files changed, 593 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/refinery 
refs/changes/62/394062/1

diff --git a/oozie/cassandra/bundle.xml b/oozie/cassandra/bundle.xml
index 0a4e656..99b8226 100644
--- a/oozie/cassandra/bundle.xml
+++ b/oozie/cassandra/bundle.xml
@@ -211,6 +211,59 @@
 
 
 
+
+
+top_bycountry_datasets_file
+${pageview_datasets_file}
+
+
+top_bycountry_dataset_name
+pageview_hourly
+
+
+top_bycountry_dataset_freq
+hour
+
+
+top_bycountry_hive_script
+pageview_top_bycountry.hql
+
+
+top_bycountry_source_table
+wmf.pageview_hourly
+
+
+top_bycountry_parallel_loaders
+3
+
+
+top_bycountry_keyspace
+local_group_default_T_top_pageviews_bycountry
+
+
+top_bycountry_cql
+UPDATE "${top_articles_keyspace}"."data" SET 
"countriesJSON" = ?
+
+
+top_bycountry_hive_fields
+project,year,month,day,countriesJSON
+
+
+top_bycountry_hive_fields_types
+text,text,text,text,text
+
+
+top_bycountry_cassandra_fields
+countriesJSON
+
+
+top_bycountry_cassandra_primary_keys
+_domain,project,year,month,day,_tid
+
+
+
 
@@ -660,6 +713,142 @@
 
 
 
+
+
+
+${coordinator_file_daily}
+
+
+workflow_file
+${workflow_file_daily}
+
+
+
+
+datasets_file
+${top_bycountry_datasets_file}
+
+
+dataset_name
+${top_bycountry_dataset_name}
+
+
+
+dataset_freq
+${top_bycountry_dataset_freq}
+
+
+
+
+hive_script
+${top_bycountry_hive_script}
+
+
+source_table
+${top_bycountry_source_table}
+
+
+
+
+cassandra_parallel_loaders
+${top_bycountry_parallel_loaders}
+
+
+cassandra_cql
+${top_bycountry_cql}
+
+
+cassandra_keyspace
+${top_bycountry_keyspace}
+
+
+hive_fields
+${top_bycountry_hive_fields}
+
+
+hive_fields_types
+${top_bycountry_hive_fields_types}
+
+
+cassandra_fields
+${top_bycountry_cassandra_fields}
+
+
+cassandra_primary_keys
+${top_bycountry_cassandra_primary_keys}
+
+
+
+
+
+${coordinator_file_monthly}
+
+
+workflow_file
+${workflow_file_monthly}
+
+
+
+
+datasets_file
+${top_bycountry_datasets_file}
+
+
+dataset_name
+${top_bycountry_dataset_name}
+
+
+
+dataset_freq
+${top_bycountry_dataset_freq}
+
+
+
+
+hive_script
+${top_bycountry_hive_script}
+
+
+source_table
+${top_bycountry_source_table}
+
+
+
+
+cassandra_parallel_loaders
+${top_bycountry_parallel_loaders}
+
+
+cassandra_cql
+${top_bycountry_cql}
+
+
+cassandra_keyspace
+${top_bycountry_keyspace}
+
+
+

[MediaWiki-commits] [Gerrit] analytics/aqs[master]: [wip] Add pageviews by country endpoint

2017-11-27 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393591 )

Change subject: [wip] Add pageviews by country endpoint
..

[wip] Add pageviews by country endpoint

Adds a new tops endpoint to aqs that returns top countries by number
of pageviews for a given project and time range.

Change-Id: I88c28812b8f2a854ed9ec5abacbc5c42c85db194
---
M sys/pageviews.js
M sys/pageviews.yaml
M test/aqs_test_module.yaml
M test/features/pageviews/pageviews.js
M v1/pageviews.yaml
5 files changed, 218 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/aqs 
refs/changes/91/393591/1

diff --git a/sys/pageviews.js b/sys/pageviews.js
index a9ef7cd..f3a532a 100644
--- a/sys/pageviews.js
+++ b/sys/pageviews.js
@@ -31,6 +31,7 @@
 articleFlat: 'pageviews.per.article.flat',
 project_v2: 'pageviews.per.project.v2',
 tops: 'top.pageviews',
+bycountry: 'top.bycountry'
 };
 
 const tableSchemas = {
@@ -92,6 +93,27 @@
 index: [
 { attribute: 'project', type: 'hash' },
 { attribute: 'access', type: 'hash' },
+{ attribute: 'year', type: 'hash' },
+{ attribute: 'month', type: 'hash' },
+{ attribute: 'day', type: 'hash' },
+]
+},
+bycountry: {
+table: tables.bycountry,
+version: 1,
+attributes: {
+project: 'string',
+year: 'string',
+month: 'string',
+day: 'string',
+// this is deprecated, it used to be json stringified to look like:
+// [{\"rank\": 1, \"article\": \"<>\", \"views\": 123}, ...]
+countries: 'string',
+// this will be preferred to articles and uses the same format
+countriesJSON: 'json'
+},
+index: [
+{ attribute: 'project', type: 'hash' },
 { attribute: 'year', type: 'hash' },
 { attribute: 'month', type: 'hash' },
 { attribute: 'day', type: 'hash' },
@@ -309,6 +331,54 @@
 });
 };
 
+PJVS.prototype.pageviewsByCountry = function(hyper, req) {
+const rp = req.params;
+
+aqsUtil.validateYearMonthDay(rp);
+
+const dataRequest = hyper.get({
+uri: tableURI(rp.domain, tables.bycountry),
+body: {
+table: tables.bycountry,
+attributes: {
+project: rp.project,
+year: rp.year,
+month: rp.month,
+day: rp.day
+}
+}
+
+}).catch(aqsUtil.notFoundCatcher);
+
+return dataRequest.then(aqsUtil.normalizeResponse).then((res) => {
+if (res.body.items) {
+res.body.items.forEach((item) => {
+// prefer the articlesJSON column if it's loaded
+if (item.countriesJSON !== null) {
+item.countries = item.countriesJSON;
+} else {
+try {
+item.countries = JSON.parse(item.countries);
+} catch (e) {
+throw new HTTPError({
+status: 500,
+body: {
+type: 'error',
+description: 'This response contained invalid 
JSON, we are ' +
+'working on fixing the problem, but until 
then you can ' +
+'try a different date.'
+}
+});
+}
+}
+delete item.countriesJSON;
+});
+}
+
+return res;
+});
+};
+
 
 module.exports = function(options) {
 const pjvs = new PJVS(options);
@@ -319,6 +389,7 @@
 pageviewsForArticle: pjvs.pageviewsForArticleFlat.bind(pjvs),
 pageviewsForProjects: pjvs.pageviewsForProjects.bind(pjvs),
 pageviewsForTops: pjvs.pageviewsForTops.bind(pjvs),
+pageviewsByCountry: pjvs.pageviewsByCountry.bind(pjvs),
 },
 resources: [
 {
@@ -332,6 +403,10 @@
 // top pageviews table
 uri: `/{domain}/sys/table/${tables.tops}`,
 body: tableSchemas.tops,
+}, {
+// pageviews by country table
+uri: `/{domain}/sys/table/${tables.bycountry}`,
+body: tableSchemas.bycountry,
 }
 ]
 };
diff --git a/sys/pageviews.yaml b/sys/pageviews.yaml
index cfb824a..afc2eb4 100644
--- a/sys/pageviews.yaml
+++ b/sys/pageviews.yaml
@@ -11,3 +11,7 @@
 get:
   summary: query top pageviews
   operationId: pageviewsForTops
+/bycountry/{project}/{year}/{month}/{day}:
+get:
+  summary: query top countries by pageviews
+  operationId: pageviewsByCountry
diff --git a/test/aqs_test_module.yaml 

[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.0.11

2017-11-27 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393586 )

Change subject: Release 2.0.11
..


Release 2.0.11

Change-Id: I9469f566bd8ad5b14bbf4e09b633197a567706bf
---
M dist/index.html
A dist/main.bundle.c4603511208e0d6eb76a.css
A dist/main.bundle.c4603511208e0d6eb76a.js
A dist/static/fonts/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.e3c13d0.woff2
A dist/static/fonts/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.b3e9d41.woff2
A dist/static/fonts/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.b270452.woff2
A dist/static/fonts/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.bf912df.woff2
M package.json
M src/App.vue
A src/components/CentralNotice.vue
M src/components/dashboard/MetricWidget.vue
M src/components/detail/GraphPanel.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/components/detail/chart/TableChart.vue
M src/config/metrics/content.js
M src/config/metrics/contributing.js
A src/config/metrics/metricSchema.js
M src/config/metrics/reading.js
A src/lato/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.woff2
A src/lato/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2
A src/lato/AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2
A src/lato/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.woff2
A src/lato/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2
A src/lato/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2
A src/lato/cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2
A src/lato/lato.css
A src/lato/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2
M src/main.js
M src/models/GraphModel.js
M src/store/index.js
M src/utils.js
A test/metrics/metrics.spec.js
M webpack/base.config.js
M webpack/prod.config.js
35 files changed, 623 insertions(+), 40 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/393586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I9469f566bd8ad5b14bbf4e09b633197a567706bf
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[release]: Release 2.0.11

2017-11-27 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393586 )

Change subject: Release 2.0.11
..

Release 2.0.11

Change-Id: I9469f566bd8ad5b14bbf4e09b633197a567706bf
---
M dist/index.html
A dist/main.bundle.c4603511208e0d6eb76a.css
A dist/main.bundle.c4603511208e0d6eb76a.js
A dist/static/fonts/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.e3c13d0.woff2
A dist/static/fonts/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.b3e9d41.woff2
A dist/static/fonts/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.b270452.woff2
A dist/static/fonts/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.bf912df.woff2
M package.json
M src/App.vue
A src/components/CentralNotice.vue
M src/components/dashboard/MetricWidget.vue
M src/components/detail/GraphPanel.vue
M src/components/detail/chart/BarChart.vue
M src/components/detail/chart/LineChart.vue
M src/components/detail/chart/TableChart.vue
M src/config/metrics/content.js
M src/config/metrics/contributing.js
A src/config/metrics/metricSchema.js
M src/config/metrics/reading.js
A src/lato/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.woff2
A src/lato/8qcEw_nrk_5HEcCpYdJu8BTbgVql8nDJpwnrE27mub0.woff2
A src/lato/AcvTq8Q0lyKKNxRlL28Rn4X0hVgzZQUfRDuZrPvH3D8.woff2
A src/lato/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.woff2
A src/lato/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.woff2
A src/lato/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.woff2
A src/lato/cT2GN3KRBUX69GVJ2b2hxn-_kf6ByYO6CLYdB4HQE-Y.woff2
A src/lato/lato.css
A src/lato/rZPI2gHXi8zxUjnybc2ZQFKPGs1ZzpMvnHX-7fPOuAc.woff2
M src/main.js
M src/models/GraphModel.js
M src/store/index.js
M src/utils.js
A test/metrics/metrics.spec.js
M webpack/base.config.js
M webpack/prod.config.js
35 files changed, 623 insertions(+), 40 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/86/393586/1


-- 
To view, visit https://gerrit.wikimedia.org/r/393586
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9469f566bd8ad5b14bbf4e09b633197a567706bf
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: release
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.0.11

2017-11-27 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/393584 )

Change subject: Release 2.0.11
..


Release 2.0.11

Change-Id: I6e5e0bb0ce15542716b5d842e3ebc807d72c2c94
---
M dist/index.html
D dist/main.bundle.247511c45b47a15db9d1.js
A dist/main.bundle.c4603511208e0d6eb76a.css
A dist/main.bundle.c4603511208e0d6eb76a.js
A dist/static/fonts/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.e3c13d0.woff2
A dist/static/fonts/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.b3e9d41.woff2
A dist/static/fonts/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.b270452.woff2
A dist/static/fonts/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.bf912df.woff2
M package.json
M src/models/GraphModel.js
10 files changed, 252 insertions(+), 52 deletions(-)

Approvals:
  Fdans: Verified; Looks good to me, approved




-- 
To view, visit https://gerrit.wikimedia.org/r/393584
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I6e5e0bb0ce15542716b5d842e3ebc807d72c2c94
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 
Gerrit-Reviewer: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Release 2.0.11

2017-11-27 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/393584 )

Change subject: Release 2.0.11
..

Release 2.0.11

Change-Id: I6e5e0bb0ce15542716b5d842e3ebc807d72c2c94
---
M dist/index.html
D dist/main.bundle.247511c45b47a15db9d1.js
A dist/main.bundle.c4603511208e0d6eb76a.css
A dist/main.bundle.c4603511208e0d6eb76a.js
A dist/static/fonts/1KWMyx7m-L0fkQGwYhWwuuvvDin1pK8aKteLpeZ5c0A.e3c13d0.woff2
A dist/static/fonts/HkF_qI1x_noxlxhrhMQYEJBw1xU1rKptJj_0jans920.b3e9d41.woff2
A dist/static/fonts/MDadn8DQ_3oT6kvnUq_2r_esZW2xOQ-xsNqO47m55DA.b270452.woff2
A dist/static/fonts/MgNNr5y1C_tIEuLEmicLmwLUuEpTyoUstqEm5AMlJo4.bf912df.woff2
M package.json
M src/models/GraphModel.js
10 files changed, 252 insertions(+), 52 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/84/393584/1


-- 
To view, visit https://gerrit.wikimedia.org/r/393584
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I6e5e0bb0ce15542716b5d842e3ebc807d72c2c94
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: [wip] Map component and Pageviews by Country metric

2017-11-21 Thread Fdans (Code Review)
Fdans has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/392661 )

Change subject: [wip] Map component and Pageviews by Country metric
..

[wip] Map component and Pageviews by Country metric

Change-Id: I32260459b37603dfe9c4734a436010089d25f557
---
A bycountry.json
M package.json
M src/apis/aqs.js
M src/components/dashboard/MetricListWidget.vue
M src/components/dashboard/MetricWidget.vue
M src/components/detail/GraphPanel.vue
M src/components/detail/chart/MapChart.vue
A src/components/detail/chart/bycountry.js
A src/components/detail/chart/world-50m.js
M src/config/index.js
M src/config/metrics/reading.js
M src/models/GraphModel.js
12 files changed, 2,163 insertions(+), 81 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/analytics/wikistats2 
refs/changes/61/392661/1


-- 
To view, visit https://gerrit.wikimedia.org/r/392661
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I32260459b37603dfe9c4734a436010089d25f557
Gerrit-PatchSet: 1
Gerrit-Project: analytics/wikistats2
Gerrit-Branch: master
Gerrit-Owner: Fdans 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] analytics/wikistats2[master]: Add central notice component and detect adblock

2017-11-21 Thread Fdans (Code Review)
Fdans has submitted this change and it was merged. ( 
https://gerrit.wikimedia.org/r/383798 )

Change subject: Add central notice component and detect adblock
..


Add central notice component and detect adblock

Adblockers prevent wikistats from reaching AQS. This change adds an
ad test to see if there is an adblocker and warns the user about it.

Bug: T177491
Change-Id: I817dad5edd07682cfb1808384d3b9455a559d35b
---
M src/App.vue
A src/components/CentralNotice.vue
M src/store/index.js
3 files changed, 80 insertions(+), 0 deletions(-)

Approvals:
  jenkins-bot: Verified
  Fdans: Looks good to me, approved



diff --git a/src/App.vue b/src/App.vue
index 2d3f91f..91e4167 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -1,5 +1,6 @@
 
 
+
 
 
 
@@ -19,6 +20,7 @@
 
 
 import TopNav from './components/TopNav';
+import CentralNotice from './components/CentralNotice';
 import TopicExplorer from './components/TopicExplorer';
 import SiteLanguage from './components/SiteLanguage';
 import BottomFooter from './components/BottomFooter';
@@ -35,6 +37,26 @@
 BottomFooter,
 Dashboard,
 Detail,
+CentralNotice
+},
+mounted () {
+this.isAdblockerOn() && this.warnAdBlocker();
+},
+
+methods: {
+isAdblockerOn () {
+let adTest = document.createElement('div');
+adTest.innerHTML = ' ';
+adTest.className = 'adsbox';
+$(this.$el).append(adTest);
+return adTest.offsetHeight === 0;
+},
+warnAdBlocker () {
+this.$store.state.centralNotice = {
+message: 'Your ad blocker is preventing Wikistats from 
reaching the server. Disable it to be able to see all metrics correctly.',
+level: 'error'
+}
+}
 },
 data () {
 return {
diff --git a/src/components/CentralNotice.vue b/src/components/CentralNotice.vue
new file mode 100644
index 000..bd5d462
--- /dev/null
+++ b/src/components/CentralNotice.vue
@@ -0,0 +1,57 @@
+
+