]> scripts.mit.edu Git - autoinstalls/mediawiki.git/blob - maintenance/benchmarks/bench_HTTP_HTTPS.php
MediaWiki 1.17.0
[autoinstalls/mediawiki.git] / maintenance / benchmarks / bench_HTTP_HTTPS.php
1 <?php
2 /**
3  * This come from r75429 message
4  * @author Platonides 
5  */
6
7 require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
8 class bench_HTTP_HTTPS extends Benchmarker {
9
10         public function __construct() {
11                 parent::__construct();  
12         }
13
14         public function execute() {
15                 $this->bench( array(
16                         array( 'function' => array( $this, 'getHTTP' ) ),
17                         array( 'function' => array( $this, 'getHTTPS' ) ),
18                 ));
19                 print $this->getFormattedResults();
20         }
21
22         static function doRequest( $proto ) {
23                 Http::get( "$proto://localhost/" );
24         }
25
26         // bench function 1
27         function getHTTP() {
28                 $this->doRequest( 'http' );
29         }
30
31         // bench function 2
32         function getHTTPS() {
33                 $this->doRequest( 'https' );
34         }
35 }
36
37 $maintClass = 'bench_HTTP_HTTPS';
38 require_once( RUN_MAINTENANCE_IF_MAIN );