From 8a126ee3b3db6b788aa97e2f2dc953eacf69955c Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 15 Aug 2015 14:29:39 -0700 Subject: [PATCH] Switched job run time profiling to context getStats() * This replaces the scoped profiling calls Change-Id: I73caffad0e0d31d9ffbd3c0decfe31e17ea85398 --- includes/jobqueue/JobRunner.php | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) 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() ) { -- 2.20.1