r41042 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r41041‎ | r41042 | r41043 >
Date:18:56, 19 September 2008
Author:demon
Status:old
Tags:
Comment:
+4 docs, -4 @todo's
Modified paths:
  • /trunk/phase3/maintenance/benchmarkPurge.php (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/benchmarkPurge.php
@@ -9,7 +9,12 @@
1010 /** */
1111 require_once( "commandLine.inc" );
1212
13 -/** @todo document */
 13+/**
 14+ * Run a bunch of URLs through SquidUpdate::purge()
 15+ * to benchmark Squid response times.
 16+ * @param $urls array A bunch of URLs to purge
 17+ * @param $trials int How many times to run the test?
 18+ */
1419 function benchSquid( $urls, $trials = 1 ) {
1520 $start = wfTime();
1621 for( $i = 0; $i < $trials; $i++) {
@@ -22,7 +27,10 @@
2328 count( $urls ), $pertrial * 1000.0, $pertitle * 1000.0 );
2429 }
2530
26 -/** @todo document */
 31+/**
 32+ * Get an array of randomUrl()'s.
 33+ * @param $length int How many urls to add to the array
 34+ */
2735 function randomUrlList( $length ) {
2836 $list = array();
2937 for( $i = 0; $i < $length; $i++ ) {
@@ -31,13 +39,19 @@
3240 return $list;
3341 }
3442
35 -/** @todo document */
 43+/**
 44+ * Return a random URL of the wiki. Not necessarily an actual title in the
 45+ * database, but at least a URL that looks like one.
 46+ */
3647 function randomUrl() {
3748 global $wgServer, $wgArticlePath;
3849 return $wgServer . str_replace( '$1', randomTitle(), $wgArticlePath );
3950 }
4051
41 -/** @todo document */
 52+/**
 53+ * Create a random title string (not necessarily a Title object).
 54+ * For use with randomUrl().
 55+ */
4256 function randomTitle() {
4357 $str = '';
4458 $length = mt_rand( 1, 20 );

Status & tagging log