Mattflaschen has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/351098 )

Change subject: Add number of pages to dump_redis.php
......................................................................

Add number of pages to dump_redis.php

This is a proxy for the size used.

Bug: T158239
Change-Id: Ie467065bba86d3b096f03f41b78e0e193451d940
---
M maintenance/dump_redis.php
1 file changed, 7 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/GettingStarted 
refs/changes/98/351098/1

diff --git a/maintenance/dump_redis.php b/maintenance/dump_redis.php
index 3f58e82..ca7de93 100755
--- a/maintenance/dump_redis.php
+++ b/maintenance/dump_redis.php
@@ -36,27 +36,32 @@
                $this->output( "Key: $key\n" );
                $this->output( 
"===========================================================\n" );
                $members = $client->sMembers( $key );
+               $pageCount = 0;
                foreach ( $members as $ind => $el ) {
                        $this->output( "$ind) \"$el\"\n" );
+                       $pageCount++;
                }
                $this->output( "\n" );
+               return $pageCount;
        }
 
        public function execute() {
                $client = RedisCategorySync::getSlave();
+               $totalPageCount = 0;
                if ( $this->hasOption( 'all' ) ) {
                        $keys = $client->keys( 'RedisCategorySync*' );
                        foreach ( $keys as $key ) {
-                               $this->printSet( $client, $key );
+                               $totalPageCount += $this->printSet( $client, 
$key );
                        }
                } else {
                        $categories = RedisCategorySync::getCategories();
                        foreach ( $categories as $catName ) {
                                $cat = \Category::newFromName( $catName );
                                $key = RedisCategorySync::makeCategoryKey( $cat 
);
-                               $this->printSet( $client, $key, $catName );
+                               $totalPageCount += $this->printSet( $client, 
$key, $catName );
                        }
                }
+               $this->output( "Total Page Count: $totalPageCount\n" );
        }
 }
 

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ie467065bba86d3b096f03f41b78e0e193451d940
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to