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

Change subject: Revert "Add overview of dispatch states to DispatchStats."
......................................................................


Revert "Add overview of dispatch states to DispatchStats."

This reverts commit bc8a0e51418ec6981002c0add3aa04175322253d.

Change-Id: I34aaff749968836b285243b39d0d42f0598f57b4
---
M repo/Wikibase.i18n.php
M repo/includes/specials/SpecialDispatchStats.php
M repo/includes/store/sql/DispatchStats.php
3 files changed, 1 insertion(+), 94 deletions(-)

Approvals:
  Jeroen De Dauw: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/repo/Wikibase.i18n.php b/repo/Wikibase.i18n.php
index 108fc24..f871559 100644
--- a/repo/Wikibase.i18n.php
+++ b/repo/Wikibase.i18n.php
@@ -188,13 +188,6 @@
        'wikibase-dispatchstats-stalest' => 'Stalest',
        'wikibase-dispatchstats-median'  => 'Median',
        'wikibase-dispatchstats-average' => 'Average',
-       'wikibase-dispatchstats-state' => 'Status',
-       'wikibase-dispatchstats-count' => 'Number',
-       'wikibase-dispatchstats-total' => 'Total',
-       'wikibase-dispatchstats-state-pending' => 'pending',
-       'wikibase-dispatchstats-state-locked' => 'locked',
-       'wikibase-dispatchstats-state-complete' => 'complete',
-       'wikibase-dispatchstats-state-fresh' => 'fresh',
        'special-listdatatypes' => 'List of all datatypes available',
        'wikibase-listdatatypes-intro' => 'This is a list of all datatypes 
currently in use on this installation:',
        'wikibase-history-title-with-label' => 'Revision history of "$2" ($1)',
@@ -762,13 +755,6 @@
        'wikibase-dispatchstats-median' => "Row header for the median client 
wiki, such that half of the client wikis are fresher and half are staler than 
this one, so it's differ from {{msg-mw|Wikibase-dispatchstats-average}}.",
        'wikibase-dispatchstats-average' => 'Row header for average lag values
 {{Identical|Average}}',
-       'wikibase-dispatchstats-state' => 'Column header for the column showing 
the client state',
-       'wikibase-dispatchstats-count' => 'Column header for the column showing 
the number of clients',
-       'wikibase-dispatchstats-total' => 'Row with the total number of 
clients',
-       'wikibase-dispatchstats-state-pending' => 'Row with the number of 
clients that are awaiting processing by a dispatcher',
-       'wikibase-dispatchstats-state-locked' => 'Row with the number of 
clients that are currently being processed by a dispatcher',
-       'wikibase-dispatchstats-state-complete' => 'Row with the number of 
clients that are up to date',
-       'wikibase-dispatchstats-state-fresh' => 'Row with the number of clients 
that have recently been processed',
        'special-listdatatypes' => '{{doc-special|ListDataTypes}}
 This special page returns a list of available datatypes (such as 
commonsMedia)',
        'wikibase-listdatatypes-intro' => 'Intro text for the ListDatatypes 
special page.',
diff --git a/repo/includes/specials/SpecialDispatchStats.php 
b/repo/includes/specials/SpecialDispatchStats.php
index bdef495..3273d3c 100644
--- a/repo/includes/specials/SpecialDispatchStats.php
+++ b/repo/includes/specials/SpecialDispatchStats.php
@@ -114,8 +114,6 @@
                        $lang->timeanddate( $stats->getMaxChangeTimestamp() ),
                ) );
 
-               //TODO: calculate changes/minute over the last hour. Cache it 
for a minute or so.
-
                $this->getOutput()->addHTML( Html::closeElement( 'table' ));
 
                // dispatch stats ------
@@ -151,31 +149,6 @@
                        $this->msg( 'wikibase-dispatchstats-average' )->text(),
                        $stats->getAverage()
                );
-
-               $this->getOutput()->addHTML( Html::closeElement( 'table' ));
-
-               // client states ------
-               $this->getOutput()->addHTML( Html::openElement( 'table', array( 
'class' => 'wikitable' ) ));
-
-               $this->outputRow( array(
-                       $this->msg( 'wikibase-dispatchstats-state' )->text(),
-                       $this->msg( 'wikibase-dispatchstats-count' )->text(),
-               ), 'th' );
-
-               $this->outputRow( array(
-                       $this->msg( 'wikibase-dispatchstats-total' )->text(),
-                       $stats->getClientCount()
-               ) );
-
-               foreach ( \Wikibase\DispatchStats::$states as $state ) {
-                       // This uses the following messages: 
wikibase-dispatchstats-state-pending,
-                       // wikibase-dispatchstats-state-locked, 
wikibase-dispatchstats-state-complete,
-                       // wikibase-dispatchstats-state-fresh
-                       $this->outputRow( array(
-                               $this->msg( 'wikibase-dispatchstats-state-' . 
$state )->text(),
-                               $stats->getStateCount( $state )
-                       ) );
-               }
 
                $this->getOutput()->addHTML( Html::closeElement( 'table' ));
        }
diff --git a/repo/includes/store/sql/DispatchStats.php 
b/repo/includes/store/sql/DispatchStats.php
index 6cadccc..036fb1c 100644
--- a/repo/includes/store/sql/DispatchStats.php
+++ b/repo/includes/store/sql/DispatchStats.php
@@ -29,13 +29,6 @@
  */
 class DispatchStats {
 
-       public static $states = array(
-               'complete',
-               'locked',
-               'fresh',
-               'pending'
-       );
-
        /**
         * @var string
         */
@@ -60,19 +53,6 @@
         * @var null|object
         */
        protected $average;
-
-       /**
-        * @var int: Number of seconds to wait before dispatching to the same 
wiki again.
-        *           This affects the effective batch size, and this influences 
how changes
-        *           can be coalesced.
-        */
-       protected $dispatchInterval = 60; //XXX: keep default synced with 
dispatchChanges.php
-
-       /**
-        * @var int: Number of seconds to wait before testing a lock. Any 
target with a lock
-        *           timestamp newer than this will not be considered for 
selection.
-        */
-       protected $lockGraceInterval = 60; //XXX: keep default synced with 
dispatchChanges.php
 
        /**
         * creates a new DispatchStats instance.
@@ -148,8 +128,6 @@
 
                while ( $row = $res->fetchObject() ) {
                        if ( $this->changeStats ) {
-                               $time = (int)wfTimestamp( TS_UNIX, 
$row->change_time );
-
                                // time between last dispatch and now
                                $row->chd_untouched = max( 0, $now
                                        - (int)wfTimestamp( TS_UNIX, 
$row->chd_touched ) );
@@ -160,27 +138,16 @@
                                        $row->chd_lag = null;
                                } else {
                                        $row->chd_lag = max( 0, 
(int)wfTimestamp( TS_UNIX, $this->changeStats->max_time )
-                                               - $time );
+                                               - (int)wfTimestamp( TS_UNIX, 
$row->change_time ) );
                                }
 
                                // number of changes that have not been 
processed yet
                                $row->chd_pending = 
(int)$this->changeStats->max_id - $row->chd_seen;
-
-                               if ( $row->chd_pending === 0 ) {
-                                       $row->chd_state = "complete";
-                               } else if ( ( $time + $this->dispatchInterval ) 
> $now ) {
-                                       $row->chd_state = "fresh";
-                               } else if ( $row->chd_lock && ( ( $time + 
$this->lockGraceInterval ) > $now ) ) {
-                                       $row->chd_state = "locked";
-                               } else {
-                                       $row->chd_state = "pending";
-                               }
                        } else {
                                // if there are no changes, there is no lag
                                $row->chd_untouched = 0;
                                $row->chd_pending = 0;
                                $row->chd_lag = 0;
-                               $row->chd_state = "complete";
                        }
 
                        $this->average->chd_untouched += $row->chd_untouched;
@@ -353,25 +320,6 @@
         */
        public function getMinChangeTimestamp() {
                return $this->changeStats->min_time;
-       }
-
-       /**
-        * returns the number of clients with the given dispatch state.
-        *
-        * @param string $state one of "complete", "locked", "fresh" or 
"pending".
-        *
-        * @return string
-        */
-       public function getStateCount( $state ) {
-               $c = 0;
-
-               foreach ( $this->clientStates as $row ) {
-                       if ( $row->chd_state === $state ) {
-                               $c++;
-                       }
-               }
-
-               return $c;
        }
 
 }

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I34aaff749968836b285243b39d0d42f0598f57b4
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/Wikibase
Gerrit-Branch: master
Gerrit-Owner: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: Jeroen De Dauw <jeroended...@gmail.com>
Gerrit-Reviewer: jenkins-bot

_______________________________________________
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to