r91191 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r91190‎ | r91191 | r91192 >
Date:18:14, 30 June 2011
Author:reedy
Status:deferred
Tags:
Comment:
Flesh out ComScoreUniqueVistors Metric
Modified paths:
  • /trunk/extensions/MetricsReporting/ApiAnalyticsBase.php (modified) (history)
  • /trunk/extensions/MetricsReporting/README (modified) (history)
  • /trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php (modified) (history)

Diff [purge]

Index: trunk/extensions/MetricsReporting/ApiAnalyticsBase.php
@@ -33,12 +33,17 @@
3434 $query = $this->getQueryInfo();
3535 $query['fields'] = $this->getQueryFields();
3636
 37+ // Params needed for extra filters etc
 38+ // months, normalized, data, reportlanguage
 39+ // selectregions, selectcountries, selectwebproperties, selectprojects, selectwikis, selecteditors, selectedits, selectplatform
 40+
3741 $db = $this->getDB();
3842
3943 $this->profileDBIn();
4044 $res = $db->select( $query['table'], $query['fields'], $query['conds'], __METHOD__, $query['options'], $query['join_conds'] );
4145 $this->profileDBOut();
4246
 47+ $result = $this->getResult();
4348 foreach( $res as $row ) {
4449
4550 }
Index: trunk/extensions/MetricsReporting/metrics/ComScoreUniqueVisitorMetric.php
@@ -10,11 +10,19 @@
1111 }
1212
1313 protected function getQueryInfo() {
14 - return array();
 14+ return array(
 15+ 'table' => array( 'comscore', 'comscore_regions' ),
 16+ 'conds' => array(),
 17+ 'options' => array( 'ORDER BY' => 'date, project_code, region_code' ),
 18+ 'join_conds' => array( 'comscore_regions' => array( 'LEFT JOIN', 'comscore.region_code = comscore_regions.region_code' ) ),
 19+ );
1520 }
1621
1722 protected function getQueryFields() {
18 - return array();
 23+ return array(
 24+ 'date', 'country_code', /* 'country_name', */ 'comscore.region_code',
 25+ 'region_name', 'web_property', 'project_code', 'reach', 'visitors'
 26+ );
1927 }
2028
2129 public function getDescription() {
Index: trunk/extensions/MetricsReporting/README
@@ -20,6 +20,19 @@
2121 );
2222 }
2323
 24+ protected function getQueryInfo() {
 25+ return array(
 26+ 'table' => array(),
 27+ 'conds' => array(),
 28+ 'options' => array(),
 29+ 'join_conds' => array() ),
 30+ );
 31+ }
 32+
 33+ protected function getQueryFields() {
 34+ return array();
 35+ }
 36+
2437 public function getDescription() {
2538 return 'Wikipedians like balloons, right?';
2639 }

Status & tagging log