<?php
/**
- * Squid purge benchmark script
+ * Benchmark for Squid purge.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @ingroup Benchmark
*/
-require_once( __DIR__ . '/Benchmarker.php' );
+require_once __DIR__ . '/Benchmarker.php';
+/**
+ * Maintenance script that benchmarks Squid purge.
+ *
+ * @ingroup Benchmark
+ */
class BenchmarkPurge extends Benchmarker {
public function __construct() {
* @return string
*/
private function benchSquid( $urls, $trials = 1 ) {
- $start = wfTime();
+ $start = microtime( true );
for ( $i = 0; $i < $trials; $i++ ) {
SquidUpdate::purge( $urls );
}
- $delta = wfTime() - $start;
+ $delta = microtime( true ) - $start;
$pertrial = $delta / $trials;
$pertitle = $pertrial / count( $urls );
return sprintf( "%4d titles in %6.2fms (%6.2fms each)",
}
$maintClass = "BenchmarkPurge";
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;