? array( false ) // check one "group": the generic pool
: (array)$groups;
+ $masterOnly = ( $i == DB_MASTER || $i == $this->getWriterIndex() );
+ $oldConnsOpened = $this->connsOpened; // connections open now
+
if ( $i == DB_MASTER ) {
$i = $this->getWriterIndex();
} else {
return $this->reportConnectionError();
}
+ # Profile any new connections that happen
+ if ( $this->connsOpened > $oldConnsOpened ) {
+ $host = $conn->getServer();
+ $dbname = $conn->getDBname();
+ $trxProf = Profiler::instance()->getTransactionProfiler();
+ $trxProf->recordConnection( $host, $dbname, $masterOnly );
+ }
+
return $conn;
}
$db = $e->db;
}
- $isMaster = !empty( $server['master'] );
- $trxProf = Profiler::instance()->getTransactionProfiler();
- $trxProf->recordConnection( $server['host'], $server['dbname'], $isMaster );
-
$db->setLBInfo( $server );
if ( isset( $server['fakeSlaveLag'] ) ) {
$db->setFakeSlaveLag( $server['fakeSlaveLag'] );