[FileBackend] Added some Swift listing profiling.
authorAaron Schulz <aschulz@wikimedia.org>
Sun, 20 May 2012 19:44:38 +0000 (12:44 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sun, 20 May 2012 19:44:38 +0000 (12:44 -0700)
Change-Id: I61d1ec5725be2ebed4bb08e713dfcab7e85160fc

includes/filerepo/backend/SwiftFileBackend.php

index 12fc801..2520813 100644 (file)
@@ -741,8 +741,9 @@ class SwiftFileBackend extends FileBackendStore {
         * @return Array List of relative paths of dirs directly under $dir
         */
        public function getDirListPageInternal( $fullCont, $dir, &$after, $limit, array $params ) {
-               $dirs = array();
+               wfProfileIn( __METHOD__ . '-' . $this->name );
 
+               $dirs = array();
                try {
                        $container = $this->getContainer( $fullCont );
                        $prefix = ( $dir == '' ) ? null : "{$dir}/";
@@ -788,6 +789,7 @@ class SwiftFileBackend extends FileBackendStore {
                                array( 'cont' => $fullCont, 'dir' => $dir ) );
                }
 
+               wfProfileOut( __METHOD__ . '-' . $this->name );
                return $dirs;
        }
 
@@ -806,8 +808,9 @@ class SwiftFileBackend extends FileBackendStore {
         * @return Array List of relative paths of files under $dir
         */
        public function getFileListPageInternal( $fullCont, $dir, &$after, $limit, array $params ) {
-               $files = array();
+               wfProfileIn( __METHOD__ . '-' . $this->name );
 
+               $files = array();
                try {
                        $container = $this->getContainer( $fullCont );
                        $prefix = ( $dir == '' ) ? null : "{$dir}/";
@@ -831,6 +834,7 @@ class SwiftFileBackend extends FileBackendStore {
                                array( 'cont' => $fullCont, 'dir' => $dir ) );
                }
 
+               wfProfileOut( __METHOD__ . '-' . $this->name );
                return $files;
        }