From: Max Semenik Date: Fri, 11 Mar 2016 21:11:43 +0000 (-0800) Subject: Log slow diffs X-Git-Tag: 1.31.0-rc.0~7581^2 X-Git-Url: http://git.cyclocoop.org/%7B%24admin_url%7Dcompta/comptes/journal.php?a=commitdiff_plain;h=7b18a62c0efbb7541abf1bc8d459bf6c3cf02775;p=lhc%2Fweb%2Fwiklou.git Log slow diffs Change-Id: Id17e116cd58d433bf6bb51c38096727a660135b9 --- diff --git a/includes/diff/DifferenceEngine.php b/includes/diff/DifferenceEngine.php index a1a1bb0497..f2630d935d 100644 --- a/includes/diff/DifferenceEngine.php +++ b/includes/diff/DifferenceEngine.php @@ -846,8 +846,13 @@ class DifferenceEngine extends ContextSource { $result = $this->textDiff( $otext, $ntext ); - $time = microtime( true ) - $time; - $this->getStats()->timing( 'diff_time', $time * 1000 ); + $time = intval( ( microtime( true ) - $time ) * 1000 ); + $this->getStats()->timing( 'diff_time', $time ); + // Log requests slower than 99th percentile + if ( $time > 100 && $this->mOldPage && $this->mNewPage ) { + wfDebugLog( 'diff', + "$time ms diff: {$this->mOldid} -> {$this->mNewid} {$this->mNewPage}" ); + } return $result; }