X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=maintenance%2Fbenchmarks%2FbenchmarkPurge.php;h=bb41a910937a434152da60d86d42e86af5cd17a4;hb=ad4c7e66d90f4d34102b39ddcce045af3ec40e36;hp=e681a0498e71b572f191299c646478c93d31c43f;hpb=2b14cc0096de48b4863ea7daee55951701f6dc99;p=lhc%2Fweb%2Fwiklou.git diff --git a/maintenance/benchmarks/benchmarkPurge.php b/maintenance/benchmarks/benchmarkPurge.php index e681a0498e..bb41a91093 100644 --- a/maintenance/benchmarks/benchmarkPurge.php +++ b/maintenance/benchmarks/benchmarkPurge.php @@ -1,6 +1,6 @@ addDescription( 'Benchmark the Squid purge functions.' ); + $this->addDescription( 'Benchmark the CDN purge functions.' ); } public function execute() { - global $wgUseSquid, $wgSquidServers; - if ( !$wgUseSquid ) { - $this->fatalError( "Squid purge benchmark doesn't do much without squid support on." ); + global $wgUseCdn, $wgCdnServers; + + if ( !$wgUseCdn ) { + $this->error( "CDN purge benchmark doesn't do much without CDN support on." ); } else { - $this->output( "There are " . count( $wgSquidServers ) . " defined squid servers:\n" ); + $this->output( "There are " . count( $wgCdnServers ) . " defined CDN servers:\n" ); if ( $this->hasOption( 'count' ) ) { $lengths = [ intval( $this->getOption( 'count' ) ) ]; } else { @@ -47,7 +48,7 @@ class BenchmarkPurge extends Benchmarker { } foreach ( $lengths as $length ) { $urls = $this->randomUrlList( $length ); - $trial = $this->benchSquid( $urls ); + $trial = $this->benchCdn( $urls ); $this->output( $trial . "\n" ); } } @@ -55,12 +56,12 @@ class BenchmarkPurge extends Benchmarker { /** * Run a bunch of URLs through CdnCacheUpdate::purge() - * to benchmark Squid response times. + * to benchmark CDN response times. * @param array $urls A bunch of URLs to purge * @param int $trials How many times to run the test? * @return string */ - private function benchSquid( $urls, $trials = 1 ) { + private function benchCdn( $urls, $trials = 1 ) { $start = microtime( true ); for ( $i = 0; $i < $trials; $i++ ) { CdnCacheUpdate::purge( $urls );