From: Aaron Schulz Date: Sat, 15 Aug 2015 21:29:39 +0000 (-0700) Subject: Switched job run time profiling to context getStats() X-Git-Tag: 1.31.0-rc.0~10343 X-Git-Url: http://git.cyclocoop.org/%22.%20generer_url_ecrire%28%22sites_tous%22%2C%22%22%29.%20%22?a=commitdiff_plain;h=8a126ee3b3db6b788aa97e2f2dc953eacf69955c;p=lhc%2Fweb%2Fwiklou.git Switched job run time profiling to context getStats() * This replaces the scoped profiling calls Change-Id: I73caffad0e0d31d9ffbd3c0decfe31e17ea85398 --- diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php index ac5a6fde22..700a63dc34 100644 --- a/includes/jobqueue/JobRunner.php +++ b/includes/jobqueue/JobRunner.php @@ -109,10 +109,8 @@ class JobRunner implements LoggerAwareInterface { return $response; } - $profiler = Profiler::instance(); - // Catch huge single updates that lead to slave lag - $trxProfiler = $profiler->getTransactionProfiler(); + $trxProfiler = Profiler::instance()->getTransactionProfiler(); $trxProfiler->setLogger( LoggerFactory::getInstance( 'DBPerformance' ) ); $trxProfiler->setExpectations( $wgTrxProfilerLimits['JobRunner'], __METHOD__ ); @@ -176,7 +174,6 @@ class JobRunner implements LoggerAwareInterface { $this->debugCallback( $msg ); // Run the job... - $psection = $profiler->scopedProfileIn( __METHOD__ . '-' . $jType ); $jobStartTime = microtime( true ); try { ++$jobsPopped; @@ -197,7 +194,6 @@ class JobRunner implements LoggerAwareInterface { wfGetLBFactory()->commitAll(); $timeMs = intval( ( microtime( true ) - $jobStartTime ) * 1000 ); $timeMsTotal += $timeMs; - $profiler->scopedProfileOut( $psection ); $readyTs = $job->getReadyTimestamp(); if ( $readyTs ) { @@ -206,6 +202,7 @@ class JobRunner implements LoggerAwareInterface { $stats->timing( 'jobqueue.pickup_delay.all', 1000 * $pickupDelay ); $stats->timing( "jobqueue.pickup_delay.$jType", 1000 * $pickupDelay ); } + $stats->timing( "jobqueue.run.$jType", $timeMs ); // Mark the job as done on success or when the job cannot be retried if ( $status !== false || !$job->allowRetries() ) {