- $lbs = $lbFactory->getAllMainLBs() + $lbFactory->getAllExternalLBs();
- foreach ( $lbs as $cluster => $lb ) {
- if ( $lb->getServerCount() <= 1 ) {
- continue;
- }
- $lags = $lb->getLagTimes();
- foreach ( $lags as $serverIndex => $lag ) {
- $host = $lb->getServerName( $serverIndex );
- if ( IP::isValid( $host ) ) {
- $ip = $host;
- $host = gethostbyaddr( $host );
- } else {
- $ip = gethostbyname( $host );
+ foreach ( $lbsByType as $type => $lbs ) {
+ foreach ( $lbs as $cluster => $lb ) {
+ if ( $lb->getServerCount() <= 1 ) {
+ continue;