summaryrefslogtreecommitdiff
path: root/maintenance/storage/orphanStats.php
diff options
context:
space:
mode:
Diffstat (limited to 'maintenance/storage/orphanStats.php')
-rw-r--r--maintenance/storage/orphanStats.php17
1 files changed, 12 insertions, 5 deletions
diff --git a/maintenance/storage/orphanStats.php b/maintenance/storage/orphanStats.php
index 1df1501e..c5213ad1 100644
--- a/maintenance/storage/orphanStats.php
+++ b/maintenance/storage/orphanStats.php
@@ -32,11 +32,13 @@ require_once __DIR__ . '/../Maintenance.php';
class OrphanStats extends Maintenance {
public function __construct() {
parent::__construct();
- $this->mDescription = "how some statistics on the blob_orphans table, created with trackBlobs.php";
+ $this->mDescription =
+ "Show some statistics on the blob_orphans table, created with trackBlobs.php";
}
protected function &getDB( $cluster, $groups = array(), $wiki = false ) {
$lb = wfGetLBFactory()->getExternalLB( $cluster );
+
return $lb->getConnection( DB_SLAVE );
}
@@ -54,12 +56,17 @@ class OrphanStats extends Maintenance {
foreach ( $res as $boRow ) {
$extDB = $this->getDB( $boRow->bo_cluster );
- $blobRow = $extDB->selectRow( 'blobs', '*', array( 'blob_id' => $boRow->bo_blob_id ), __METHOD__ );
+ $blobRow = $extDB->selectRow(
+ 'blobs',
+ '*',
+ array( 'blob_id' => $boRow->bo_blob_id ),
+ __METHOD__
+ );
$num++;
$size = strlen( $blobRow->blob_text );
$totalSize += $size;
- $hashes[ sha1( $blobRow->blob_text ) ] = true;
+ $hashes[sha1( $blobRow->blob_text )] = true;
$maxSize = max( $size, $maxSize );
}
unset( $res );
@@ -67,8 +74,8 @@ class OrphanStats extends Maintenance {
$this->output( "Number of orphans: $num\n" );
if ( $num > 0 ) {
$this->output( "Average size: " . round( $totalSize / $num, 0 ) . " bytes\n" .
- "Max size: $maxSize\n" .
- "Number of unique texts: " . count( $hashes ) . "\n" );
+ "Max size: $maxSize\n" .
+ "Number of unique texts: " . count( $hashes ) . "\n" );
}
}
}