[FileBackend] Added profiling calls to addMissingMetadata().
authorAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Aug 2012 02:46:43 +0000 (19:46 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Fri, 17 Aug 2012 02:46:43 +0000 (19:46 -0700)
Change-Id: I1bc624516542d07b2c4c428532d653e33d3c758a

includes/filebackend/SwiftFileBackend.php

index d13ac22..661076a 100644 (file)
@@ -714,6 +714,7 @@ class SwiftFileBackend extends FileBackendStore {
                if ( isset( $obj->metadata['Sha1base36'] ) ) {
                        return true; // nothing to do
                }
+               wfProfileIn( __METHOD__ );
                $status = Status::newGood();
                $scopeLockS = $this->getScopedFileLocks( array( $path ), LockManager::LOCK_UW, $status );
                if ( $status->isOK() ) {
@@ -724,11 +725,13 @@ class SwiftFileBackend extends FileBackendStore {
                                if ( $hash !== false ) {
                                        $obj->metadata['Sha1base36'] = $hash;
                                        $obj->sync_metadata(); // save to Swift
+                                       wfProfileOut( __METHOD__ );
                                        return true; // success
                                }
                        }
                }
                $obj->metadata['Sha1base36'] = false;
+               wfProfileOut( __METHOD__ );
                return false; // failed
        }