r99669 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99668‎ | r99669 | r99670 >
Date:05:38, 13 October 2011
Author:aaron
Status:ok
Tags:
Comment:
fixed warnings for stats update (for flagged protection)
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/FlaggedRevs/dataclasses/FlaggedRevsStats.php (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/extensions/FlaggedRevs/dataclasses/FlaggedRevsStats.php
@@ -197,11 +197,19 @@
198198 }
199199
200200 private function getReviewTimesAnons( $dbCache ) {
 201+ $result = array(
 202+ 'average' => 0,
 203+ 'median' => 0,
 204+ 'percTable' => array(),
 205+ 'sampleSize' => 0,
 206+ 'sampleStartTS' => null,
 207+ 'sampleEndTS' => null
 208+ );
 209+ if ( FlaggedRevs::useOnlyIfProtected() ) {
 210+ return $result; // disabled
 211+ }
201212 $aveRT = $medianRT = 0;
202213 $rPerTable = array(); // review wait percentiles
203 - if ( FlaggedRevs::useOnlyIfProtected() ) {
204 - return array( $aveRT, $medianRT, $rPerTable ); // disabled
205 - }
206214 $nowUnix = wfTimestamp( TS_UNIX ); // current time in UNIX TS
207215 # Only go so far back...otherwise we will get garbage values due to
208216 # the fact that FlaggedRevs wasn't enabled until after a while.
@@ -351,15 +359,14 @@
352360 $rPerTable[$percentile] = $times[$rank];
353361 }
354362 #echo "(sampled ".count($times)." edits)...";
 363+ $result['average'] = $aveRT;
 364+ $result['median'] = $medianRT;
 365+ $result['percTable'] = $rPerTable;
 366+ $result['sampleSize'] = count( $times );
 367+ $result['sampleStartTS'] = $minTSUnix;
 368+ $result['sampleEndTS'] = $maxTSUnix;
355369 }
356370
357 - return array(
358 - 'average' => $aveRT,
359 - 'median' => $medianRT,
360 - 'percTable' => $rPerTable,
361 - 'sampleSize' => count( $times ),
362 - 'sampleStartTS' => $minTSUnix,
363 - 'sampleEndTS' => $maxTSUnix
364 - );
 371+ return $result;
365372 }
366373 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r99670Ported r99669 to /trunkaaron05:40, 13 October 2011

Status & tagging log