r75566 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75565‎ | r75566 | r75567 >
Date:19:19, 27 October 2010
Author:hashar
Status:ok
Tags:
Comment:
Compare latency between http and https by querying localhost.
Modified paths:
  • /trunk/phase3/maintenance/benchmarks/bench_HTTP_HTTPS.php (added) (history)

Diff [purge]

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

Status & tagging log