Revert "Added per-wiki queue stats information"
authorOri.livneh <ori@wikimedia.org>
Mon, 20 Apr 2015 19:22:30 +0000 (19:22 +0000)
committerOri.livneh <ori@wikimedia.org>
Mon, 20 Apr 2015 19:31:03 +0000 (19:31 +0000)
Creates too many metrics.
This reverts commit 340220080eb8a21744686b6397d0a6a2115c9742.

Task: T95913
Change-Id: Ifa478996febcdd6b3687c4cb64b215495514a899

includes/jobqueue/JobQueue.php
includes/jobqueue/JobQueueDB.php
includes/jobqueue/JobQueueRedis.php

index ef718e0..7df85ff 100644 (file)
@@ -359,7 +359,7 @@ abstract class JobQueue {
                // Flag this job as an old duplicate based on its "root" job...
                try {
                        if ( $job && $this->isRootJobOldDuplicate( $job ) ) {
-                               JobQueue::incrStats( 'job-pop-duplicate', $this->type, 1, $this->wiki );
+                               JobQueue::incrStats( 'job-pop-duplicate', $this->type );
                                $job = DuplicateJob::newFromJob( $job ); // convert to a no-op
                        }
                } catch ( Exception $e ) {
@@ -703,15 +703,11 @@ abstract class JobQueue {
         * @param string $key Event type
         * @param string $type Job type
         * @param int $delta
-        * @param string $wiki Wiki ID (added in 1.23)
         * @since 1.22
         */
-       public static function incrStats( $key, $type, $delta = 1, $wiki = null ) {
+       public static function incrStats( $key, $type, $delta = 1 ) {
                wfIncrStats( $key, $delta );
                wfIncrStats( "{$key}-{$type}", $delta );
-               if ( $wiki !== null ) {
-                       wfIncrStats( "{$key}-{$type}-{$wiki}", $delta );
-               }
        }
 
        /**
index 9e85e40..320b1b1 100644 (file)
@@ -256,12 +256,11 @@ class JobQueueDB extends JobQueue {
                        foreach ( array_chunk( $rows, 50 ) as $rowBatch ) {
                                $dbw->insert( 'job', $rowBatch, $method );
                        }
-                       JobQueue::incrStats( 'job-insert', $this->type, count( $rows ), $this->wiki );
+                       JobQueue::incrStats( 'job-insert', $this->type, count( $rows ) );
                        JobQueue::incrStats(
                                'job-insert-duplicate',
                                $this->type,
-                               count( $rowSet ) + count( $rowList ) - count( $rows ),
-                               $this->wiki
+                               count( $rowSet ) + count( $rowList ) - count( $rows )
                        );
                } catch ( DBError $e ) {
                        if ( $flags & self::QOS_ATOMIC ) {
@@ -312,7 +311,7 @@ class JobQueueDB extends JobQueue {
                                        $this->cache->set( $this->getCacheKey( 'empty' ), 'true', self::CACHE_TTL_LONG );
                                        break; // nothing to do
                                }
-                               JobQueue::incrStats( 'job-pop', $this->type, 1, $this->wiki );
+                               JobQueue::incrStats( 'job-pop', $this->type );
                                // Get the job object from the row...
                                $title = Title::makeTitle( $row->job_namespace, $row->job_title );
                                $job = Job::factory( $row->job_cmd, $title,
@@ -680,7 +679,7 @@ class JobQueueDB extends JobQueue {
                                        );
                                        $affected = $dbw->affectedRows();
                                        $count += $affected;
-                                       JobQueue::incrStats( 'job-recycle', $this->type, $affected, $this->wiki );
+                                       JobQueue::incrStats( 'job-recycle', $this->type, $affected );
                                        // The tasks recycled jobs or release delayed jobs into the queue
                                        $this->cache->set( $this->getCacheKey( 'empty' ), 'false', self::CACHE_TTL_LONG );
                                        $this->aggr->notifyQueueNonEmpty( $this->wiki, $this->type );
@@ -709,7 +708,7 @@ class JobQueueDB extends JobQueue {
                                $dbw->delete( 'job', array( 'job_id' => $ids ), __METHOD__ );
                                $affected = $dbw->affectedRows();
                                $count += $affected;
-                               JobQueue::incrStats( 'job-abandon', $this->type, $affected, $this->wiki );
+                               JobQueue::incrStats( 'job-abandon', $this->type, $affected );
                        }
 
                        $dbw->unlock( "jobqueue-recycle-{$this->type}", __METHOD__ );
index 0f87df7..275d027 100644 (file)
@@ -222,9 +222,9 @@ class JobQueueRedis extends JobQueue {
 
                                throw new RedisException( "Could not insert {$failed} {$this->type} job(s)." );
                        }
-                       JobQueue::incrStats( 'job-insert', $this->type, count( $items ), $this->wiki );
+                       JobQueue::incrStats( 'job-insert', $this->type, count( $items ) );
                        JobQueue::incrStats( 'job-insert-duplicate', $this->type,
-                               count( $items ) - $failed - $pushed, $this->wiki );
+                               count( $items ) - $failed - $pushed );
                } catch ( RedisException $e ) {
                        $this->throwRedisException( $conn, $e );
                }
@@ -300,7 +300,7 @@ LUA;
                                        break; // no jobs; nothing to do
                                }
 
-                               JobQueue::incrStats( 'job-pop', $this->type, 1, $this->wiki );
+                               JobQueue::incrStats( 'job-pop', $this->type );
                                $item = $this->unserialize( $blob );
                                if ( $item === false ) {
                                        wfDebugLog( 'JobQueueRedis', "Could not unserialize {$this->type} job." );