45 if ( $conn ===
null ) {
46 return parent::getWeightScale( $index, $conn );
50 if ( $this->warmCacheRatio > 0 ) {
51 $res = $conn->query(
'SHOW STATUS', __METHOD__ );
54 $host = $this->lb->getServerName( $index );
55 $this->replLogger->error( __METHOD__ .
": could not get status for $host" );
58 if (
$s->Innodb_buffer_pool_pages_total > 0 ) {
59 $ratio =
$s->Innodb_buffer_pool_pages_data /
$s->Innodb_buffer_pool_pages_total;
64 $weight *= min( $ratio / $this->warmCacheRatio, 1.0 );