Optimize for the common case where lag does not strictly increase
during trip times instead of being pessimistic.
Change-Id: Ibb0e3faad23862d397e1cc2a9f7e2a8293fa5f2b
* @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 {
$this->restoreFlags();
}
- return [ $row ? $row->ts : null, microtime( true ) ];
+ return [ $row ? $row->ts : null, $nowUnix ];
}
protected function getApproximateLagStatus() {