[FileBackend] Added profiling to doQuickOperationsInternal().
authorAaron <aschulz@wikimedia.org>
Thu, 17 May 2012 21:18:45 +0000 (14:18 -0700)
committerAaron <aschulz@wikimedia.org>
Thu, 17 May 2012 21:18:45 +0000 (14:18 -0700)
Change-Id: I98ce4bdfb61bf55b5306dabf0f20427c26319c3c

includes/filerepo/backend/FileBackendStore.php

index 5537e93..62c32eb 100644 (file)
@@ -943,6 +943,8 @@ abstract class FileBackendStore extends FileBackend {
         * @throws MWException
         */
        final protected function doQuickOperationsInternal( array $ops ) {
+               wfProfileIn( __METHOD__ );
+               wfProfileIn( __METHOD__ . '-' . $this->name );
                $status = Status::newGood();
 
                $async = $this->parallelize;
@@ -955,6 +957,8 @@ abstract class FileBackendStore extends FileBackend {
                foreach ( $ops as $index => $params ) {
                        $method = $params['op'] . 'Internal'; // e.g. "storeInternal"
                        if ( !MWInit::methodExists( __CLASS__, $method ) ) {
+                               wfProfileOut( __METHOD__ . '-' . $this->name );
+                               wfProfileOut( __METHOD__ );
                                throw new MWException( "Operation '{$params['op']}' is not supported." );
                        }
                        $subStatus = $this->$method( array( 'async' => $async ) + $params );
@@ -987,6 +991,8 @@ abstract class FileBackendStore extends FileBackend {
                        }
                }
 
+               wfProfileOut( __METHOD__ . '-' . $this->name );
+               wfProfileOut( __METHOD__ );
                return $status;
        }