* Profiling: total module execution time
*/
private $mTimeIn = 0, $mModuleTime = 0;
+ /** @var ScopedCallback */
+ private $profile;
+ /** @var ScopedCallback */
+ private $dbProfile;
/**
* Get the name of the module as shown in the profiler log
ApiBase::dieDebug( __METHOD__, 'Called twice without calling profileOut()' );
}
$this->mTimeIn = microtime( true );
- wfProfileIn( $this->getModuleProfileName() );
+ $this->profile = Profiler::instance()->scopedProfileIn( $this->getModuleProfileName() );
}
/**
$this->mModuleTime += microtime( true ) - $this->mTimeIn;
$this->mTimeIn = 0;
- wfProfileOut( $this->getModuleProfileName() );
+ Profiler::instance()->scopedProfileOut( $this->profile );
}
/**
ApiBase::dieDebug( __METHOD__, 'Called twice without calling profileDBOut()' );
}
$this->mDBTimeIn = microtime( true );
- wfProfileIn( $this->getModuleProfileName( true ) );
+
+ $this->dbProfile = Profiler::instance()->scopedProfileIn( $this->getModuleProfileName( true ) );
}
/**
$this->mDBTime += $time;
$this->getMain()->mDBTime += $time;
- wfProfileOut( $this->getModuleProfileName( true ) );
+ Profiler::instance()->scopedProfileOut( $this->dbProfile );
}
/**