* @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() {
if ( $limit > 0 && $time > $limit ) {
throw new DBTransactionSizeError(
$conn,
- "Transaction spent $time second(s) in writes, exceeding the $limit limit.",
+ "Transaction spent $time second(s) in writes, exceeding the limit of $limit.",
[ $time, $limit ]
);
}
}
protected function feedItemDesc( $row ) {
- $revision = $this->revisionFromRcResult( $row );
- if ( $revision ) {
- // XXX: include content model/type in feed item?
- return '<p>' . htmlspecialchars( $revision->getUserText() ) .
- $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
- htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
- "</p>\n<hr />\n<div>" .
- nl2br( htmlspecialchars( $revision->getContent()->serialize() ) ) . "</div>";
+ $revision = Revision::newFromId( $row->rev_id );
+ if ( !$revision ) {
+ return '';
}
- return '';
+ $content = $revision->getContent();
+ if ( $content === null ) {
+ return '';
+ }
+
+ // XXX: include content model/type in feed item?
+ return '<p>' . htmlspecialchars( $revision->getUserText() ) .
+ $this->msg( 'colon-separator' )->inContentLanguage()->escaped() .
+ htmlspecialchars( FeedItem::stripComment( $revision->getComment() ) ) .
+ "</p>\n<hr />\n<div>" .
+ nl2br( htmlspecialchars( $content->serialize() ) ) . "</div>";
}
protected function getGroupName() {