$trxProfiler = Profiler::instance()->getTransactionProfiler();
$trxProfiler->setExpectation( 'masterConns', 0, __METHOD__ );
$trxProfiler->setExpectation( 'writes', 0, __METHOD__ );
+ $trxProfiler->setExpectation( 'maxAffected', 500, __METHOD__ );
}
// If the user has forceHTTPS set to true, or if the user
protected $dbLockThreshold = 3.0;
/** @var float Seconds */
protected $eventThreshold = .25;
- /** @var integer */
- protected $affectedThreshold = 500;
/** @var array transaction ID => (write start time, list of DBs involved) */
protected $dbTrxHoldingLocks = array();
'writes' => INF,
'queries' => INF,
'conns' => INF,
- 'masterConns' => INF
+ 'masterConns' => INF,
+ 'maxAffected' => INF
);
/** @var array */
protected $expectBy = array();
$eTime = microtime( true );
$elapsed = ( $eTime - $sTime );
- if ( $isWrite && $n > $this->affectedThreshold && PHP_SAPI !== 'cli' ) {
+ if ( $isWrite && $n > $this->expect['maxAffected'] ) {
wfDebugLog( 'DBPerformance',
- "Query affected $n rows:\n" . $query . "\n" . wfBacktrace( true ) );
+ "Query affected $n row(s):\n" . $query . "\n" . wfBacktrace( true ) );
}
// Report when too many writes/queries happen...