From 787f2dfc36724eaafeb984a490f7d9e7f5aacb0d Mon Sep 17 00:00:00 2001 From: "Ori.livneh" Date: Mon, 20 Apr 2015 19:22:30 +0000 Subject: [PATCH] Revert "Added per-wiki queue stats information" Creates too many metrics. This reverts commit 340220080eb8a21744686b6397d0a6a2115c9742. Task: T95913 Change-Id: Ifa478996febcdd6b3687c4cb64b215495514a899 --- includes/jobqueue/JobQueue.php | 8 ++------ includes/jobqueue/JobQueueDB.php | 11 +++++------ includes/jobqueue/JobQueueRedis.php | 6 +++--- 3 files changed, 10 insertions(+), 15 deletions(-) diff --git a/includes/jobqueue/JobQueue.php b/includes/jobqueue/JobQueue.php index ef718e0c41..7df85ff0f4 100644 --- a/includes/jobqueue/JobQueue.php +++ b/includes/jobqueue/JobQueue.php @@ -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 ); - } } /** diff --git a/includes/jobqueue/JobQueueDB.php b/includes/jobqueue/JobQueueDB.php index 9e85e40ad4..320b1b1a8d 100644 --- a/includes/jobqueue/JobQueueDB.php +++ b/includes/jobqueue/JobQueueDB.php @@ -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__ ); diff --git a/includes/jobqueue/JobQueueRedis.php b/includes/jobqueue/JobQueueRedis.php index 0f87df75c2..275d02710f 100644 --- a/includes/jobqueue/JobQueueRedis.php +++ b/includes/jobqueue/JobQueueRedis.php @@ -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." ); -- 2.20.1