From 3f53862f4c7c55f2c2b2ab5501078d4d2b9dffc3 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Fri, 19 Apr 2013 13:06:11 -0700 Subject: [PATCH] Added abandoned job stats. Change-Id: I3ef8c56e1a3e16875c7282afc4d3d0b135bd776d --- includes/job/JobQueueDB.php | 1 + includes/job/JobQueueRedis.php | 1 + 2 files changed, 2 insertions(+) diff --git a/includes/job/JobQueueDB.php b/includes/job/JobQueueDB.php index e4825edc3e..a685fe3505 100644 --- a/includes/job/JobQueueDB.php +++ b/includes/job/JobQueueDB.php @@ -614,6 +614,7 @@ class JobQueueDB extends JobQueue { if ( count( $ids ) ) { $dbw->delete( 'job', array( 'job_id' => $ids ), __METHOD__ ); $count += $dbw->affectedRows(); + JobQueue::incrStats( 'job-abandon', $this->type, $dbw->affectedRows() ); } $dbw->unlock( "jobqueue-recycle-{$this->type}", __METHOD__ ); diff --git a/includes/job/JobQueueRedis.php b/includes/job/JobQueueRedis.php index f083fcc7b6..a55e9996da 100644 --- a/includes/job/JobQueueRedis.php +++ b/includes/job/JobQueueRedis.php @@ -650,6 +650,7 @@ LUA; list( $released, $abandoned, $pruned ) = $res; $count += $released + $pruned; JobQueue::incrStats( 'job-recycle', $this->type, count( $released ) ); + JobQueue::incrStats( 'job-abandon', $this->type, count( $abandoned ) ); } } catch ( RedisException $e ) { $this->throwRedisException( $this->server, $conn, $e ); -- 2.20.1