Added abandoned job stats.
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 19 Apr 2013 20:06:11 +0000 (13:06 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 19 Apr 2013 20:06:11 +0000 (13:06 -0700)
Change-Id: I3ef8c56e1a3e16875c7282afc4d3d0b135bd776d

includes/job/JobQueueDB.php
includes/job/JobQueueRedis.php

index e4825ed..a685fe3 100644 (file)
@@ -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__ );
index f083fcc..a55e999 100644 (file)
@@ -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 );