summaryrefslogtreecommitdiff
path: root/maintenance/benchmarks/bench_HTTP_HTTPS.php
blob: 13d15fce21893e43418645c4f8a759602d0e10f3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
<?php
/**
 * This come from r75429 message
 * @author Platonides 
 */

require_once( dirname( __FILE__ ) . '/Benchmarker.php' );
class bench_HTTP_HTTPS extends Benchmarker {

	public function __construct() {
		parent::__construct();	
	}

	public function execute() {
		$this->bench( array(
			array( 'function' => array( $this, 'getHTTP' ) ),
			array( 'function' => array( $this, 'getHTTPS' ) ),
		));
		print $this->getFormattedResults();
	}

	static function doRequest( $proto ) {
		Http::get( "$proto://localhost/" );
	}

	// bench function 1
	function getHTTP() {
		$this->doRequest( 'http' );
	}

	// bench function 2
	function getHTTPS() {
		$this->doRequest( 'https' );
	}
}

$maintClass = 'bench_HTTP_HTTPS';
require_once( RUN_MAINTENANCE_IF_MAIN );