Merge "Improve beginMasterChanges and make methods for DeferredUpdates"
[lhc/web/wiklou.git] / includes / db / IDatabase.php
index 4ad23dd..5f543c3 100644 (file)
@@ -42,7 +42,7 @@ interface IDatabase {
 
        /** @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 */
@@ -50,7 +50,7 @@ interface IDatabase {
        /** @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';
@@ -59,6 +59,11 @@ interface IDatabase {
        /** @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.
@@ -211,10 +216,11 @@ interface IDatabase {
         *
         * 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
@@ -1503,9 +1509,10 @@ interface IDatabase {
        /**
         * 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.