Merge "Removed executeReadyPeriodicTasks() method"
[lhc/web/wiklou.git] / includes / jobqueue / JobRunner.php
index 5c68d90..6bf33aa 100644 (file)
@@ -109,8 +109,10 @@ class JobRunner implements LoggerAwareInterface {
                        return $response;
                }
 
+               $profiler = Profiler::instance();
+
                // Catch huge single updates that lead to slave lag
-               $trxProfiler = Profiler::instance()->getTransactionProfiler();
+               $trxProfiler = $profiler->getTransactionProfiler();
                $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) );
                $trxProfiler->setExpectations( $wgTrxProfilerLimits['JobRunner'], __METHOD__ );
 
@@ -168,10 +170,11 @@ class JobRunner implements LoggerAwareInterface {
                                }
 
                                $msg = $job->toString() . " STARTING";
-                               $this->logger->info( $msg );
+                               $this->logger->debug( $msg );
                                $this->debugCallback( $msg );
 
                                // Run the job...
+                               $psection = $profiler->scopedProfileIn( __METHOD__ . '-' . $jType );
                                $jobStartTime = microtime( true );
                                try {
                                        ++$jobsRun;
@@ -186,6 +189,7 @@ class JobRunner implements LoggerAwareInterface {
                                }
                                $timeMs = intval( ( microtime( true ) - $jobStartTime ) * 1000 );
                                $timeMsTotal += $timeMs;
+                               $profiler->scopedProfileOut( $psection );
 
                                // Mark the job as done on success or when the job cannot be retried
                                if ( $status !== false || !$job->allowRetries() ) {