Merge "Remove some duplicate code in ProfilerSimpleTrace"
authorHashar <hashar@free.fr>
Thu, 5 Apr 2012 08:24:32 +0000 (08:24 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 5 Apr 2012 08:24:32 +0000 (08:24 +0000)
includes/profiler/ProfilerSimpleTrace.php

index 57fbb6f..7602f06 100644 (file)
  * @ingroup Profiler
  */
 class ProfilerSimpleTrace extends ProfilerSimple {
-       var $trace = "";
+       var $trace = "Beginning trace: \n";
        var $memory = 0;
 
-       function addInitialStack() {
-               $initialTime = $this->getInitialTime();
-               $initialCpu = $this->getInitialTime( 'cpu' );
-               if ( $initialTime !== null && $initialCpu !== null ) {
-                       $this->mWorkStack[] = array( '-total', 0, $initialTime, $initialCpu );
-               }
-               $this->trace .= "Beginning trace: \n";
-       }
-
-       function profileIn($functionname) {
-               $this->mWorkStack[] = array( $functionname, count( $this->mWorkStack ), $this->getTime(), $this->getTime( 'cpu' ) );
+       function profileIn( $functionname ) {
+               parent::profileIn( $functionname );
                $this->trace .= "         " . sprintf("%6.1f",$this->memoryDiff()) .
                                str_repeat( " ", count($this->mWorkStack)) . " > " . $functionname . "\n";
        }