r11989 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11988‎ | r11989 | r11990 >
Date:13:08, 6 December 2005
Author:timstarling
Status:old
Tags:
Comment:
Measurement of the pre-profile setup time
Modified paths:
  • /trunk/phase3/includes/Profiling.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Profiling.php
@@ -44,14 +44,19 @@
4545 class Profiler {
4646 var $mStack = array (), $mWorkStack = array (), $mCollated = array ();
4747 var $mCalls = array (), $mTotals = array ();
48 - /*
 48+
4949 function Profiler()
5050 {
51 - $this->mProfileStack = array();
52 - $this->mWorkStack = array();
53 - $this->mCollated = array();
 51+ // Push an entry for the pre-profile setup time onto the stack
 52+ global $wgRequestTime;
 53+ if ( !empty( $wgRequestTime ) ) {
 54+ $this->mWorkStack[] = array( '-total', 0, $wgRequestTime, 0 );
 55+ $this->mStack[] = array( '-setup', 1, $wgRequestTime, 0, microtime(), 0 );
 56+ } else {
 57+ $this->profileIn( '-total' );
 58+ }
 59+
5460 }
55 - */
5661
5762 function profileIn($functionname) {
5863 global $wgDebugFunctionEntry;
@@ -349,5 +354,5 @@
350355 }
351356
352357 $wgProfiler = new Profiler();
353 -$wgProfiler->profileIn('-total');
 358+
354359 ?>

Status & tagging log