jenkins-bot has submitted this change and it was merged. (
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, 9 insertions(+), 4 deletions(-)
Approvals:
Krinkle: Looks good to me, approved
jenkins-bot: Verified
diff --git a/maintenance/dump_redis.php b/maintenance/dump_redis.php
index 3f58e82..6f31881 100755
--- a/maintenance/dump_redis.php
+++ b/maintenance/dump_redis.php
@@ -29,36 +29,41 @@
$this->mDescription = 'Dump Redis data used for
RedisCategorySync';
}
- protected function printSet( $client, $key, $categoryName = null ) {
+ protected function printSet( RedisConnRef $client, $key, $categoryName
= null ) {
if ( $categoryName !== null ) {
$this->output( "Cat: $categoryName\n" );
}
$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" );
}
}
$maintClass = 'GettingStarted\DumpRedisCategorySync';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
--
To view, visit https://gerrit.wikimedia.org/r/351098
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ie467065bba86d3b096f03f41b78e0e193451d940
Gerrit-PatchSet: 2
Gerrit-Project: mediawiki/extensions/GettingStarted
Gerrit-Branch: master
Gerrit-Owner: Mattflaschen <[email protected]>
Gerrit-Reviewer: Elukey <[email protected]>
Gerrit-Reviewer: Giuseppe Lavagetto <[email protected]>
Gerrit-Reviewer: Krinkle <[email protected]>
Gerrit-Reviewer: Phuedx <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits