r91331 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91330‎ | r91331 | r91332 >
Date:23:50, 1 July 2011
Author:reedy
Status:deferred
Tags:
Comment:
Add in canBeNormalised()
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/SquidPageViewsMetric.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -46,7 +46,7 @@
4747 . " AND date <= " . $db->addQuotes( $params['endmonth'] ) ;
4848 }
4949
50 - if ( $params['normalized'] ) {
 50+ if ( $params['normalized'] && $this->canBeNormalised() ) {
5151 // TODO: Do data normalisation stuffs here
5252 }
5353
@@ -66,6 +66,10 @@
6767 }
6868 }
6969 // TODO: Change join based on selected language $params['reportlanguage']
 70+ // TODO: Also, work out which queries can deal with the parameter
 71+ //if () {
 72+ // $query['conds']['reportlanguage'] = $params['reportlanguage'];
 73+ //}
7074
7175 foreach( $this->getAllowedFilters() as $filter ) {
7276 if ( /*isset( $params[$filter] ) && */count( $params[$filter] ) ) {
@@ -179,6 +183,13 @@
180184 protected abstract function getQueryFields();
181185
182186 /**
 187+ * @return bool
 188+ */
 189+ protected function canBeNormalised() {
 190+ return false;
 191+ }
 192+
 193+ /**
183194 * @return array
184195 */
185196 public function getAllowedFilters() {
Index: trunk/extensions/MetricsReporting/metrics/SquidPageViewsMetric.php
@@ -26,6 +26,10 @@
2727 return array();
2828 }
2929
 30+ protected function canBeNormalised() {
 31+ return true;
 32+ }
 33+
3034 public function getDescription() {
3135 return array(
3236 'Total articles (htm component) requested from nearly all Wikimedia wikis (exceptions are mostly special purpose wikis, e.g. wikimania wikis)',

Status & tagging log