Merge "Made LoadMonitor use wfGlobalCacheKey() and tweaked the key name"
[lhc/web/wiklou.git] / includes / jobqueue / JobRunner.php
index efc36cc..3982134 100644 (file)
@@ -126,7 +126,7 @@ class JobRunner implements LoggerAwareInterface {
                }
 
                $group = JobQueueGroup::singleton();
-               
+
                // Flush any pending DB writes for sanity
                wfGetLBFactory()->commitAll();
 
@@ -199,10 +199,12 @@ class JobRunner implements LoggerAwareInterface {
                                $timeMsTotal += $timeMs;
                                $profiler->scopedProfileOut( $psection );
 
-                               if ( $job->getQueuedTimestamp() ) {
+                               $readyTs = $job->getReadyTimestamp();
+                               if ( $readyTs ) {
                                        // Record time to run for the job type
-                                       $stats->timing( "job-pickuptime-$jType",
-                                               $popTime - $job->getQueuedTimestamp() );
+                                       $pickupDelay = $popTime - $readyTs;
+                                       $stats->timing( 'jobqueue.pickup_delay.all', $pickupDelay );
+                                       $stats->timing( "jobqueue.pickup_delay.$jType", $pickupDelay );
                                }
 
                                // Mark the job as done on success or when the job cannot be retried