MediaWiki
REL1_31
bench_HTTP_HTTPS.php
Go to the documentation of this file.
1
<?php
27
require_once __DIR__ .
'/Benchmarker.php'
;
28
34
class
BenchHttpHttps
extends
Benchmarker
{
35
public
function
__construct
() {
36
parent::__construct();
37
$this->
addDescription
(
'Benchmark HTTP request vs HTTPS request.'
);
38
}
39
40
public
function
execute
() {
41
$this->
bench
( [
42
[
'function'
=> [ $this,
'getHTTP'
] ],
43
[
'function'
=> [ $this,
'getHTTPS'
] ],
44
] );
45
}
46
47
private
function
doRequest
( $proto ) {
48
Http::get
(
"$proto://localhost/"
, [], __METHOD__ );
49
}
50
51
// bench function 1
52
protected
function
getHTTP
() {
53
$this->
doRequest
(
'http'
);
54
}
55
56
// bench function 2
57
protected
function
getHTTPS
() {
58
$this->
doRequest
(
'https'
);
59
}
60
}
61
62
$maintClass
= BenchHttpHttps::class;
63
require_once
RUN_MAINTENANCE_IF_MAIN
;
$maintClass
$maintClass
Definition
bench_HTTP_HTTPS.php:62
BenchHttpHttps
Maintenance script that benchmarks HTTP request vs HTTPS request.
Definition
bench_HTTP_HTTPS.php:34
BenchHttpHttps\__construct
__construct()
Default constructor.
Definition
bench_HTTP_HTTPS.php:35
BenchHttpHttps\getHTTPS
getHTTPS()
Definition
bench_HTTP_HTTPS.php:57
BenchHttpHttps\execute
execute()
Do the actual work.
Definition
bench_HTTP_HTTPS.php:40
BenchHttpHttps\getHTTP
getHTTP()
Definition
bench_HTTP_HTTPS.php:52
BenchHttpHttps\doRequest
doRequest( $proto)
Definition
bench_HTTP_HTTPS.php:47
Benchmarker
Base class for benchmark scripts.
Definition
Benchmarker.php:40
Benchmarker\bench
bench(array $benchs)
Definition
Benchmarker.php:50
Http\get
static get( $url, $options=[], $caller=__METHOD__)
Simple wrapper for Http::request( 'GET' )
Definition
Http.php:98
Maintenance\addDescription
addDescription( $text)
Set the description text.
Definition
Maintenance.php:291
RUN_MAINTENANCE_IF_MAIN
require_once RUN_MAINTENANCE_IF_MAIN
Definition
maintenance.txt:50
maintenance
benchmarks
bench_HTTP_HTTPS.php
Generated on Mon Nov 25 2024 15:35:56 for MediaWiki by
1.10.0