r84214 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84213‎ | r84214 | r84215 >
Date:23:16, 17 March 2011
Author:tstarling
Status:ok
Tags:
Comment:
Profiling sections for network operations
Modified paths:
  • /trunk/extensions/PoolCounter/PoolCounterClient_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/PoolCounter/PoolCounterClient_body.php
@@ -29,9 +29,11 @@
3030 if ( count( $parts ) < 2 ) {
3131 $parts[] = 7531;
3232 }
 33+ wfProfileIn( __METHOD__.'-connect' );
3334 wfSuppressWarnings();
3435 $conn = fsockopen( $parts[0], $parts[1], $errno, $errstr, $this->timeout );
3536 wfRestoreWarnings();
 37+ wfProfileOut( __METHOD__.'-connect' );
3638 if ( $conn ) {
3739 break;
3840 }
@@ -122,20 +124,28 @@
123125 }
124126
125127 function acquireForMe() {
126 - return $this->sendCommand( 'ACQ4ME', $this->key, $this->workers, $this->maxqueue, $this->timeout );
 128+ wfProfileIn( __METHOD__ );
 129+ $status = $this->sendCommand( 'ACQ4ME', $this->key, $this->workers, $this->maxqueue, $this->timeout );
 130+ wfProfileOut( __METHOD__ );
 131+ return $status;
127132 }
128133
129134 function acquireForAnyone() {
130 - return $this->sendCommand( 'ACQ4ANY', $this->key, $this->workers, $this->maxqueue, $this->timeout );
 135+ wfProfileIn( __METHOD__ );
 136+ $status = $this->sendCommand( 'ACQ4ANY', $this->key, $this->workers, $this->maxqueue, $this->timeout );
 137+ wfProfileOut( __METHOD__ );
 138+ return $status;
131139 }
132140
133141 function release() {
 142+ wfProfileIn( __METHOD__ );
134143 $status = $this->sendCommand( 'RELEASE', $this->key );
135144
136145 if ( $this->conn ) {
137146 self::$manager->close( $this->conn );
138147 $this->conn = null;
139148 }
 149+ wfProfileOut( __METHOD__ );
140150 return $status;
141151 }
142152 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r84225MFT r84214: PoolCounter profilingtstarling02:32, 18 March 2011

Status & tagging log