From: Aaron Schulz Date: Thu, 17 Aug 2017 19:31:23 +0000 (-0700) Subject: Make mysql getHeartbeatData() method not count query/RTT in estimate X-Git-Tag: 1.31.0-rc.0~2369^2 X-Git-Url: http://git.cyclocoop.org/%7B%24www_url%7Dadmin/password.php?a=commitdiff_plain;h=07cd19aeee112edad98832621b3f0b7b1d6f69a5;p=lhc%2Fweb%2Fwiklou.git Make mysql getHeartbeatData() method not count query/RTT in estimate Optimize for the common case where lag does not strictly increase during trip times instead of being pessimistic. Change-Id: Ibb0e3faad23862d397e1cc2a9f7e2a8293fa5f2b --- diff --git a/includes/libs/rdbms/database/DatabaseMysqlBase.php b/includes/libs/rdbms/database/DatabaseMysqlBase.php index 991e0c6660..692ddb70b8 100644 --- a/includes/libs/rdbms/database/DatabaseMysqlBase.php +++ b/includes/libs/rdbms/database/DatabaseMysqlBase.php @@ -778,6 +778,8 @@ abstract class DatabaseMysqlBase extends Database { * @see https://www.percona.com/doc/percona-toolkit/2.1/pt-heartbeat.html */ protected function getHeartbeatData( array $conds ) { + // Query time and trip time are not counted + $nowUnix = microtime( true ); // Do not bother starting implicit transactions here $this->clearFlag( self::DBO_TRX, self::REMEMBER_PRIOR ); try { @@ -793,7 +795,7 @@ abstract class DatabaseMysqlBase extends Database { $this->restoreFlags(); } - return [ $row ? $row->ts : null, microtime( true ) ]; + return [ $row ? $row->ts : null, $nowUnix ]; } protected function getApproximateLagStatus() {