dépôts
/
lhc
/
web
/
wiklou.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge "Support GENDER in MediaWiki:Blockip and Special:Block"
[lhc/web/wiklou.git]
/
maintenance
/
benchmarks
/
benchmarkPurge.php
diff --git
a/maintenance/benchmarks/benchmarkPurge.php
b/maintenance/benchmarks/benchmarkPurge.php
index
1797358
..
42c1eb7
100644
(file)
--- a/
maintenance/benchmarks/benchmarkPurge.php
+++ b/
maintenance/benchmarks/benchmarkPurge.php
@@
-29,7
+29,6
@@
require_once __DIR__ . '/Benchmarker.php';
* @ingroup Benchmark
*/
class BenchmarkPurge extends Benchmarker {
* @ingroup Benchmark
*/
class BenchmarkPurge extends Benchmarker {
-
public function __construct() {
parent::__construct();
$this->mDescription = "Benchmark the Squid purge functions.";
public function __construct() {
parent::__construct();
$this->mDescription = "Benchmark the Squid purge functions.";
@@
-69,6
+68,7
@@
class BenchmarkPurge extends Benchmarker {
$delta = microtime( true ) - $start;
$pertrial = $delta / $trials;
$pertitle = $pertrial / count( $urls );
$delta = microtime( true ) - $start;
$pertrial = $delta / $trials;
$pertitle = $pertrial / count( $urls );
+
return sprintf( "%4d titles in %6.2fms (%6.2fms each)",
count( $urls ), $pertrial * 1000.0, $pertitle * 1000.0 );
}
return sprintf( "%4d titles in %6.2fms (%6.2fms each)",
count( $urls ), $pertrial * 1000.0, $pertitle * 1000.0 );
}
@@
-83,6
+83,7
@@
class BenchmarkPurge extends Benchmarker {
for ( $i = 0; $i < $length; $i++ ) {
$list[] = $this->randomUrl();
}
for ( $i = 0; $i < $length; $i++ ) {
$list[] = $this->randomUrl();
}
+
return $list;
}
return $list;
}
@@
-93,6
+94,7
@@
class BenchmarkPurge extends Benchmarker {
*/
private function randomUrl() {
global $wgServer, $wgArticlePath;
*/
private function randomUrl() {
global $wgServer, $wgArticlePath;
+
return $wgServer . str_replace( '$1', $this->randomTitle(), $wgArticlePath );
}
return $wgServer . str_replace( '$1', $this->randomTitle(), $wgArticlePath );
}
@@
-107,6
+109,7
@@
class BenchmarkPurge extends Benchmarker {
for ( $i = 0; $i < $length; $i++ ) {
$str .= chr( mt_rand( ord( 'a' ), ord( 'z' ) ) );
}
for ( $i = 0; $i < $length; $i++ ) {
$str .= chr( mt_rand( ord( 'a' ), ord( 'z' ) ) );
}
+
return ucfirst( $str );
}
}
return ucfirst( $str );
}
}