r91134 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91133‎ | r91134 | r91135 >
Date:22:59, 29 June 2011
Author:reedy
Status:deferred
Tags:
Comment:
Add getAllowedFilters() to SquidPageViewsMetric

Start querying interface, added abstracts in ApiAnalyticsBase
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/ComScoreReachPercentageMetric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/DumpActiveEditors100Metric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/DumpActiveEditors5Metric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/DumpArticleCountMetric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/DumpBinaryCountMetric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/DumpEditsMetric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/DumpNewRegisteredEditorsMetric.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/SquidPageViewsMetric.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -28,8 +28,16 @@
2929 }
3030
3131 public function execute() {
 32+ $params = $this->extractRequestParams();
 33+
 34+ $query = $this->getQueryInfo();
 35+ $query['fields'] = $this->getQueryFields();
3236 }
3337
 38+ protected abstract function getQueryInfo();
 39+
 40+ protected abstract function getQueryFields();
 41+
3442 /**
3543 * @return array
3644 */
@@ -395,10 +403,32 @@
396404 ' growth percentages are relative to oldest value (80->100=25%) although trivial, requesting these metrics through API ensures all clients use same calculation',
397405 ),
398406 'reportlanguage' => 'Language code, used to expand region and country codes into region and country name',
399 - 'selectregions' => '',
400 - 'selectcountries' => '',
 407+ 'selectregions' => array(
 408+ 'What region',
 409+ ' as = Asia Pacific',
 410+ ' c = China',
 411+ ' eu = Europe',
 412+ ' i = India',
 413+ ' la = Latin-America',
 414+ ' ma = Middle-East/Africa',
 415+ ' na = North-America',
 416+ ' us = United States',
 417+ ' w = World',
 418+ ),
 419+ 'selectcountries' => 'What country, based on ISO 3166-1 codes',
401420 'selectwebproperties' => '',
402 - 'selectprojects' => '',
 421+ 'selectprojects' => array(
 422+ 'Which projects',
 423+ ' wb = Wikibooks',
 424+ ' wk = Wiktionary',
 425+ ' wn = Wikinews',
 426+ ' wp = Wikipedia',
 427+ ' wq = Wikiquote',
 428+ ' ws = Wikisource',
 429+ ' wv = Wikiversity',
 430+ ' co = Commons',
 431+ ' wx = Other projects',
 432+ ),
403433 'selectwikis' => '',
404434 'selecteditors' => 'a for anonymous, r for registered, b for bot',
405435 'selectedits' => 'm for manual, b for bot-induced',
Index: trunk/extensions/MetricsReporting/metrics/DumpNewRegisteredEditorsMetric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'All registered editors that in a certain month for the first time crossed the threshold of 10 edits since signing up';
1523 }
Index: trunk/extensions/MetricsReporting/metrics/ComScoreReachPercentageMetric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'Percentage of total unique visitors to any web property which also visited a Wikimedia wiki';
1523 }
Index: trunk/extensions/MetricsReporting/metrics/DumpActiveEditors100Metric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'All registered editors that made 100 or more edits in a certain month';
1523 }
Index: trunk/extensions/MetricsReporting/metrics/DumpEditsMetric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'All edits on articles (as defined by dumparticlecount)';
1523 }
Index: trunk/extensions/MetricsReporting/metrics/DumpActiveEditors5Metric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'All registered editors that made 5 or more edits in a certain month';
1523 }
Index: trunk/extensions/MetricsReporting/metrics/SquidPageViewsMetric.php
@@ -4,6 +4,12 @@
55
66 public function getAllowedFilters() {
77 return array(
 8+ 'selectregions',
 9+ 'selectcountries',
 10+ 'selectwebproperties',
 11+ 'selectprojects',
 12+ 'selectwikis',
 13+ 'selectplatform',
814 );
915 }
1016
@@ -14,6 +20,14 @@
1521 );
1622 }
1723
 24+ protected function getQueryInfo() {
 25+ return array();
 26+ }
 27+
 28+ protected function getQueryFields() {
 29+ return array();
 30+ }
 31+
1832 protected function getExamples() {
1933 return array(
2034 'api.php?action=analytics&metric=',
Index: trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'Unique persons that visited one of the Wikimedia wikis at least once in a certain month';
1523 }
Index: trunk/extensions/MetricsReporting/metrics/DumpArticleCountMetric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'All namespace 0 pages which contain an internal link minus redirect pages (for some projects extra namespaces qualify)';
1523 }
Index: trunk/extensions/MetricsReporting/metrics/DumpBinaryCountMetric.php
@@ -9,6 +9,14 @@
1010 );
1111 }
1212
 13+ protected function getQueryInfo() {
 14+ return array();
 15+ }
 16+
 17+ protected function getQueryFields() {
 18+ return array();
 19+ }
 20+
1321 public function getDescription() {
1422 return 'All binary files (nearly all of which are multimedia files) available for download/article inclusion on a wiki';
1523 }

Status & tagging log