From: Tim Starling Date: Fri, 21 Jul 2006 15:26:07 +0000 (+0000) Subject: Profiling X-Git-Tag: 1.31.0-rc.0~56173 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=b3607055ea440481f98feb886eeaf6761aec666f;p=lhc%2Fweb%2Fwiklou.git Profiling --- diff --git a/includes/Database.php b/includes/Database.php index 7ffa294587..1812cd1ec3 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -449,6 +449,7 @@ class Database { */ function open( $server, $user, $password, $dbName ) { global $wguname; + wfProfileIn( __METHOD__ ); # Test for missing mysql.so # First try to load it @@ -508,6 +509,7 @@ class Database { } $this->mOpened = $success; + wfProfileOut( __METHOD__ ); return $success; } /**@}}*/ diff --git a/includes/LoadBalancer.php b/includes/LoadBalancer.php index 314169153b..e9f712e6e1 100644 --- a/includes/LoadBalancer.php +++ b/includes/LoadBalancer.php @@ -627,6 +627,7 @@ class LoadBalancer { function getLagTimes() { global $wgDBname; + wfProfileIn( __METHOD__ ); $expiry = 5; $requestRate = 10; @@ -638,6 +639,7 @@ class LoadBalancer { $chance = max( 0, ( $expiry - $elapsed ) * $requestRate ); if ( mt_rand( 0, $chance ) != 0 ) { unset( $times['timestamp'] ); + wfProfileOut( __METHOD__ ); return $times; } } @@ -659,6 +661,8 @@ class LoadBalancer { # But don't give the timestamp to the caller unset($times['timestamp']); + wfIncrStats( 'lag_cache_miss' ); + wfProfileOut( __METHOD__ ); return $times; } }