Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php |
— | — | @@ -28,8 +28,16 @@ |
29 | 29 | } |
30 | 30 | |
31 | 31 | public function execute() { |
| 32 | + $params = $this->extractRequestParams(); |
| 33 | + |
| 34 | + $query = $this->getQueryInfo(); |
| 35 | + $query['fields'] = $this->getQueryFields(); |
32 | 36 | } |
33 | 37 | |
| 38 | + protected abstract function getQueryInfo(); |
| 39 | + |
| 40 | + protected abstract function getQueryFields(); |
| 41 | + |
34 | 42 | /** |
35 | 43 | * @return array |
36 | 44 | */ |
— | — | @@ -395,10 +403,32 @@ |
396 | 404 | ' growth percentages are relative to oldest value (80->100=25%) although trivial, requesting these metrics through API ensures all clients use same calculation', |
397 | 405 | ), |
398 | 406 | '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', |
401 | 420 | '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 | + ), |
403 | 433 | 'selectwikis' => '', |
404 | 434 | 'selecteditors' => 'a for anonymous, r for registered, b for bot', |
405 | 435 | 'selectedits' => 'm for manual, b for bot-induced', |
Index: trunk/extensions/MetricsReporting/metrics/DumpNewRegisteredEditorsMetric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'All registered editors that in a certain month for the first time crossed the threshold of 10 edits since signing up'; |
15 | 23 | } |
Index: trunk/extensions/MetricsReporting/metrics/ComScoreReachPercentageMetric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'Percentage of total unique visitors to any web property which also visited a Wikimedia wiki'; |
15 | 23 | } |
Index: trunk/extensions/MetricsReporting/metrics/DumpActiveEditors100Metric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'All registered editors that made 100 or more edits in a certain month'; |
15 | 23 | } |
Index: trunk/extensions/MetricsReporting/metrics/DumpEditsMetric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'All edits on articles (as defined by dumparticlecount)'; |
15 | 23 | } |
Index: trunk/extensions/MetricsReporting/metrics/DumpActiveEditors5Metric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'All registered editors that made 5 or more edits in a certain month'; |
15 | 23 | } |
Index: trunk/extensions/MetricsReporting/metrics/SquidPageViewsMetric.php |
— | — | @@ -4,6 +4,12 @@ |
5 | 5 | |
6 | 6 | public function getAllowedFilters() { |
7 | 7 | return array( |
| 8 | + 'selectregions', |
| 9 | + 'selectcountries', |
| 10 | + 'selectwebproperties', |
| 11 | + 'selectprojects', |
| 12 | + 'selectwikis', |
| 13 | + 'selectplatform', |
8 | 14 | ); |
9 | 15 | } |
10 | 16 | |
— | — | @@ -14,6 +20,14 @@ |
15 | 21 | ); |
16 | 22 | } |
17 | 23 | |
| 24 | + protected function getQueryInfo() { |
| 25 | + return array(); |
| 26 | + } |
| 27 | + |
| 28 | + protected function getQueryFields() { |
| 29 | + return array(); |
| 30 | + } |
| 31 | + |
18 | 32 | protected function getExamples() { |
19 | 33 | return array( |
20 | 34 | 'api.php?action=analytics&metric=', |
Index: trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'Unique persons that visited one of the Wikimedia wikis at least once in a certain month'; |
15 | 23 | } |
Index: trunk/extensions/MetricsReporting/metrics/DumpArticleCountMetric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'All namespace 0 pages which contain an internal link minus redirect pages (for some projects extra namespaces qualify)'; |
15 | 23 | } |
Index: trunk/extensions/MetricsReporting/metrics/DumpBinaryCountMetric.php |
— | — | @@ -9,6 +9,14 @@ |
10 | 10 | ); |
11 | 11 | } |
12 | 12 | |
| 13 | + protected function getQueryInfo() { |
| 14 | + return array(); |
| 15 | + } |
| 16 | + |
| 17 | + protected function getQueryFields() { |
| 18 | + return array(); |
| 19 | + } |
| 20 | + |
13 | 21 | public function getDescription() { |
14 | 22 | return 'All binary files (nearly all of which are multimedia files) available for download/article inclusion on a wiki'; |
15 | 23 | } |