Measure commitMasterChanges() run time
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 25 Oct 2015 03:59:25 +0000 (20:59 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 25 Oct 2015 03:59:25 +0000 (20:59 -0700)
Change-Id: Icf36ce5bc5b6997aec1b43e5d271ad196ab7bcb6

includes/db/loadbalancer/LBFactory.php

index e7b7627..86f0110 100644 (file)
@@ -200,7 +200,10 @@ abstract class LBFactory {
         * Commit changes on all master connections
         */
        public function commitMasterChanges() {
+               $start = microtime( true );
                $this->forEachLBCallMethod( 'commitMasterChanges' );
+               $timeMs = 1000 * ( microtime( true ) - $start );
+               RequestContext::getMain()->getStats()->timing( "db.commit-masters", $timeMs );
        }
 
        /**