/** @var string Transaction is requested by regular caller outside of the DB layer */
const TRANSACTION_EXPLICIT = '';
- /** @var string Transaction is requested interally via DBO_TRX/startAtomic() */
+ /** @var string Transaction is requested internally via DBO_TRX/startAtomic() */
const TRANSACTION_INTERNAL = 'implicit';
/** @var string Transaction operation comes from service managing all DBs */
/** @var string Transaction operation comes from the database class internally */
const FLUSHING_INTERNAL = 'flush';
- /** @var string No not remember the prior flags */
+ /** @var string Do not remember the prior flags */
const REMEMBER_NOTHING = '';
/** @var string Remember the prior flags */
const REMEMBER_PRIOR = 'remember';
/** @var string Restore to the initial flag state */
const RESTORE_INITIAL = 'initial';
+ /** @var string Estimate total time (RTT, scanning, waiting on locks, applying) */
+ const ESTIMATE_TOTAL = 'total';
+ /** @var string Estimate time to apply (scanning, applying) */
+ const ESTIMATE_DB_APPLY = 'apply';
+
/**
* A string describing the current software version, and possibly
* other details in a user-friendly way. Will be listed on Special:Version, etc.
*
* High times could be due to scanning, updates, locking, and such
*
+ * @param string $type IDatabase::ESTIMATE_* constant [default: ESTIMATE_ALL]
* @return float|bool Returns false if not transaction is active
* @since 1.26
*/
- public function pendingWriteQueryDuration();
+ public function pendingWriteQueryDuration( $type = self::ESTIMATE_TOTAL );
/**
* Get the list of method names that did write queries for this transaction
/**
* Ping the server and try to reconnect if it there is no connection
*
+ * @param float|null &$rtt Value to store the estimated RTT [optional]
* @return bool Success or failure
*/
- public function ping();
+ public function ping( &$rtt = null );
/**
* Get slave lag. Currently supported only by MySQL.