diff options
Diffstat (limited to 'includes/profiler/ProfilerSimple.php')
-rw-r--r-- | includes/profiler/ProfilerSimple.php | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/includes/profiler/ProfilerSimple.php b/includes/profiler/ProfilerSimple.php index d1d1c5d9..1d4873c6 100644 --- a/includes/profiler/ProfilerSimple.php +++ b/includes/profiler/ProfilerSimple.php @@ -29,7 +29,7 @@ class ProfilerSimple extends Profiler { var $mMinimumTime = 0; - var $zeroEntry = array('cpu'=> 0.0, 'cpu_sq' => 0.0, 'real' => 0.0, 'real_sq' => 0.0, 'count' => 0); + var $zeroEntry = array( 'cpu' => 0.0, 'cpu_sq' => 0.0, 'real' => 0.0, 'real_sq' => 0.0, 'count' => 0 ); var $errorEntry; public function isPersistent() { @@ -57,33 +57,33 @@ class ProfilerSimple extends Profiler { $this->mMinimumTime = $min; } - function profileIn($functionname) { + function profileIn( $functionname ) { global $wgDebugFunctionEntry; - if ($wgDebugFunctionEntry) { - $this->debug(str_repeat(' ', count($this->mWorkStack)).'Entering '.$functionname."\n"); + if ( $wgDebugFunctionEntry ) { + $this->debug( str_repeat( ' ', count( $this->mWorkStack ) ) . 'Entering ' . $functionname . "\n" ); } $this->mWorkStack[] = array( $functionname, count( $this->mWorkStack ), $this->getTime(), $this->getTime( 'cpu' ) ); } - function profileOut($functionname) { + function profileOut( $functionname ) { global $wgDebugFunctionEntry; - if ($wgDebugFunctionEntry) { - $this->debug(str_repeat(' ', count($this->mWorkStack) - 1).'Exiting '.$functionname."\n"); + if ( $wgDebugFunctionEntry ) { + $this->debug( str_repeat( ' ', count( $this->mWorkStack ) - 1 ) . 'Exiting ' . $functionname . "\n" ); } - list($ofname, /* $ocount */ ,$ortime,$octime) = array_pop($this->mWorkStack); + list( $ofname, /* $ocount */, $ortime, $octime ) = array_pop( $this->mWorkStack ); - if (!$ofname) { - $this->debug("Profiling error: $functionname\n"); + if ( !$ofname ) { + $this->debug( "Profiling error: $functionname\n" ); } else { - if ($functionname == 'close') { + if ( $functionname == 'close' ) { $message = "Profile section ended by close(): {$ofname}"; $functionname = $ofname; $this->debug( "$message\n" ); $this->mCollated[$message] = $this->errorEntry; } - elseif ($ofname != $functionname) { + elseif ( $ofname != $functionname ) { $message = "Profiling error: in({$ofname}), out($functionname)"; $this->debug( "$message\n" ); $this->mCollated[$message] = $this->errorEntry; @@ -91,7 +91,7 @@ class ProfilerSimple extends Profiler { $entry =& $this->mCollated[$functionname]; $elapsedcpu = $this->getTime( 'cpu' ) - $octime; $elapsedreal = $this->getTime() - $ortime; - if (!is_array($entry)) { + if ( !is_array( $entry ) ) { $entry = $this->zeroEntry; $this->mCollated[$functionname] =& $entry; } |