jenkins-bot has submitted this change and it was merged.

Change subject: Added jobqueue.pickup_root_age metric
......................................................................


Added jobqueue.pickup_root_age metric

* This tracks the average age of the root job for jobs being
  run that have root jobs defined.

Change-Id: Ifed709644cfa9ac60fc2b0cfd376142adebbaf68
---
M includes/jobqueue/JobRunner.php
1 file changed, 8 insertions(+), 1 deletion(-)

Approvals:
  Gilles: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/includes/jobqueue/JobRunner.php b/includes/jobqueue/JobRunner.php
index 700a63d..1304362 100644
--- a/includes/jobqueue/JobRunner.php
+++ b/includes/jobqueue/JobRunner.php
@@ -195,13 +195,20 @@
                                $timeMs = intval( ( microtime( true ) - 
$jobStartTime ) * 1000 );
                                $timeMsTotal += $timeMs;
 
+                               // Record how long jobs wait before getting 
popped
                                $readyTs = $job->getReadyTimestamp();
                                if ( $readyTs ) {
-                                       // Record time to run for the job type
                                        $pickupDelay = $popTime - $readyTs;
                                        $stats->timing( 
'jobqueue.pickup_delay.all', 1000 * $pickupDelay );
                                        $stats->timing( 
"jobqueue.pickup_delay.$jType", 1000 * $pickupDelay );
                                }
+                               // Record root job age for jobs being run
+                               $root = $job->getRootJobParams();
+                               if ( $root['rootJobTimestamp'] ) {
+                                       $age = $popTime - wfTimestamp( TS_UNIX, 
$root['rootJobTimestamp'] );
+                                       $stats->timing( 
"jobqueue.pickup_root_age.$jType", 1000 * $age );
+                               }
+                               // Track the execution time for jobs
                                $stats->timing( "jobqueue.run.$jType", $timeMs 
);
 
                                // Mark the job as done on success or when the 
job cannot be retried

-- 
To view, visit https://gerrit.wikimedia.org/r/233878
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: Ifed709644cfa9ac60fc2b0cfd376142adebbaf68
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/core
Gerrit-Branch: master
Gerrit-Owner: Aaron Schulz <[email protected]>
Gerrit-Reviewer: Gilles <[email protected]>
Gerrit-Reviewer: jenkins-bot <>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to