*/
function open( $server, $user, $password, $dbName ) {
global $wguname;
+ wfProfileIn( __METHOD__ );
# Test for missing mysql.so
# First try to load it
}
$this->mOpened = $success;
+ wfProfileOut( __METHOD__ );
return $success;
}
/**@}}*/
function getLagTimes() {
global $wgDBname;
+ wfProfileIn( __METHOD__ );
$expiry = 5;
$requestRate = 10;
$chance = max( 0, ( $expiry - $elapsed ) * $requestRate );
if ( mt_rand( 0, $chance ) != 0 ) {
unset( $times['timestamp'] );
+ wfProfileOut( __METHOD__ );
return $times;
}
}
# But don't give the timestamp to the caller
unset($times['timestamp']);
+ wfIncrStats( 'lag_cache_miss' );
+ wfProfileOut( __METHOD__ );
return $times;
}
}