/** * Activate the profiler (assuming $wgProfiler is set) */ protected function activateProfiler() { global $wgProfiler, $wgProfileLimit, $wgTrxProfilerLimits; $output = $this->getOption('profiler'); if (!$output) { return; } if (is_array($wgProfiler) && isset($wgProfiler['class'])) { $class = $wgProfiler['class']; $profiler = new $class(array('sampling' => 1, 'output' => array($output)) + $wgProfiler + array('threshold' => $wgProfileLimit)); $profiler->setTemplated(true); Profiler::replaceStubInstance($profiler); } $trxProfiler = Profiler::instance()->getTransactionProfiler(); $trxProfiler->setLogger(LoggerFactory::getInstance('DBPerformance')); $trxProfiler->setExpectations($wgTrxProfilerLimits['Maintenance'], __METHOD__); }
/** * Activate the profiler (assuming $wgProfiler is set) */ protected function activateProfiler() { global $wgProfiler; $output = $this->getOption('profiler'); if ($output && is_array($wgProfiler) && isset($wgProfiler['class'])) { $class = $wgProfiler['class']; $profiler = new $class(array('sampling' => 1, 'output' => $output) + $wgProfiler); $profiler->setTemplated(true); Profiler::replaceStubInstance($profiler); } }