r100105 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r100104‎ | r100105 | r100106 >
Date:02:12, 18 October 2011
Author:aaron
Status:ok
Tags:
Comment:
w/s cleanup and removed commented out code
Modified paths:
  • /trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevsStats.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/dataclasses/FlaggedRevsStats.php
@@ -93,52 +93,52 @@
9494
9595 $dataSet = array();
9696 $dataSet[] = array(
97 - 'frs_stat_key' => 'reviewLag-sampleStartTimestamp',
 97+ 'frs_stat_key' => 'reviewLag-sampleStartTimestamp',
9898 'frs_stat_val' => $reviewData['sampleStartTS'], // unix
9999 'frs_timestamp' => $encDataTimestamp );
100100 $dataSet[] = array(
101 - 'frs_stat_key' => 'reviewLag-sampleEndTimestamp',
 101+ 'frs_stat_key' => 'reviewLag-sampleEndTimestamp',
102102 'frs_stat_val' => $reviewData['sampleEndTS'], // unix
103103 'frs_timestamp' => $encDataTimestamp );
104104 // All-namespace percentiles...
105105 foreach( $reviewData['percTable'] as $percentile => $seconds ) {
106106 $dataSet[] = array(
107 - 'frs_stat_key' => 'reviewLag-percentile:'.(int)$percentile,
 107+ 'frs_stat_key' => 'reviewLag-percentile:'.(int)$percentile,
108108 'frs_stat_val' => $seconds,
109109 'frs_timestamp' => $encDataTimestamp );
110110 }
111111 // Sample size...
112112 $dataSet[] = array(
113 - 'frs_stat_key' => 'reviewLag-sampleSize',
 113+ 'frs_stat_key' => 'reviewLag-sampleSize',
114114 'frs_stat_val' => $reviewData['sampleSize'],
115115 'frs_timestamp' => $encDataTimestamp );
116116
117117 // All-namespace ave/med review lag & ave pending lag stats...
118118 $dataSet[] = array(
119 - 'frs_stat_key' => 'reviewLag-average',
 119+ 'frs_stat_key' => 'reviewLag-average',
120120 'frs_stat_val' => $reviewData['average'],
121121 'frs_timestamp' => $encDataTimestamp );
122122 $dataSet[] = array(
123 - 'frs_stat_key' => 'reviewLag-median',
 123+ 'frs_stat_key' => 'reviewLag-median',
124124 'frs_stat_val' => $reviewData['median'],
125125 'frs_timestamp' => $encDataTimestamp );
126126 $dataSet[] = array(
127 - 'frs_stat_key' => 'pendingLag-average',
 127+ 'frs_stat_key' => 'pendingLag-average',
128128 'frs_stat_val' => $avePET,
129129 'frs_timestamp' => $encDataTimestamp );
130130
131131 // Per-namespace total/reviewed/synced stats...
132132 foreach( $rNamespaces as $namespace ) {
133133 $dataSet[] = array(
134 - 'frs_stat_key' => 'totalPages-NS:'.(int)$namespace,
 134+ 'frs_stat_key' => 'totalPages-NS:'.(int)$namespace,
135135 'frs_stat_val' => isset($ns_total[$namespace]) ? $ns_total[$namespace] : 0,
136136 'frs_timestamp' => $encDataTimestamp );
137137 $dataSet[] = array(
138 - 'frs_stat_key' => 'reviewedPages-NS:'.(int)$namespace,
 138+ 'frs_stat_key' => 'reviewedPages-NS:'.(int)$namespace,
139139 'frs_stat_val' => isset($ns_reviewed[$namespace]) ? $ns_reviewed[$namespace] : 0,
140140 'frs_timestamp' => $encDataTimestamp );
141141 $dataSet[] = array(
142 - 'frs_stat_key' => 'syncedPages-NS:'.(int)$namespace,
 142+ 'frs_stat_key' => 'syncedPages-NS:'.(int)$namespace,
143143 'frs_stat_val' => isset($ns_synced[$namespace]) ? $ns_synced[$namespace] : 0,
144144 'frs_timestamp' => $encDataTimestamp );
145145 }
@@ -335,7 +335,7 @@
336336 'p.fr_page_id = rev_page',
337337 'p.fr_rev_id < rev_id', // not imported later
338338 'p.fr_timestamp < rev_timestamp' ) ),
339 - 'n' => array( 'INNER JOIN', array( // next review
 339+ 'n' => array( 'INNER JOIN', array( // next review
340340 'n.fr_page_id = rev_page',
341341 'n.fr_rev_id >= rev_id',
342342 'n.fr_timestamp >= rev_timestamp' ) )
@@ -353,7 +353,6 @@
354354 $time = max( $time, 0 ); // sanity
355355 $secondsR += $time;
356356 $times[] = $time;
357 - #echo( "\nedit:".$row->rt . "\twait:" . $time );
358357 }
359358 $sampleSize = count($times);
360359 $aveRT = ($secondsR + $secondsP)/$sampleSize; // sample mean
@@ -367,7 +366,6 @@
368367 $rank = round( $percentile*count($times)/100 + .5 ) - 1;
369368 $rPerTable[$percentile] = $times[$rank];
370369 }
371 - #echo "(sampled ".count($times)." edits)...";
372370 $result['average'] = $aveRT;
373371 $result['median'] = $medianRT;
374372 $result['percTable'] = $rPerTable;

Status & tagging log