From 6d377ae0e334ec8499fc15deada173084bc27779 Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Tue, 18 Feb 2014 11:32:51 -0800 Subject: [PATCH] Added some profiling calls to Swift backend Change-Id: Ic692c897493fe4388568930c2f4f861b89f2ff78 --- includes/filebackend/SwiftFileBackend.php | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/includes/filebackend/SwiftFileBackend.php b/includes/filebackend/SwiftFileBackend.php index 27493ae2c5..413210a6ba 100644 --- a/includes/filebackend/SwiftFileBackend.php +++ b/includes/filebackend/SwiftFileBackend.php @@ -704,7 +704,7 @@ class SwiftFileBackend extends FileBackendStore { return $objHdrs; // nothing to do } - $section = new ProfileSection( __METHOD__ ); + $section = new ProfileSection( __METHOD__ . '-' . $this->name ); trigger_error( "$path was not stored with SHA-1 metadata.", E_USER_WARNING ); $auth = $this->getAuthentication(); @@ -1306,6 +1306,8 @@ class SwiftFileBackend extends FileBackendStore { * @return array|bool|null False on 404, null on failure */ protected function getContainerStat( $container, $bypassCache = false ) { + $section = new ProfileSection( __METHOD__ . '-' . $this->name ); + if ( $bypassCache ) { // purge cache $this->containerStatCache->clear( $container ); } elseif ( !$this->containerStatCache->has( $container, 'stat' ) ) { @@ -1317,11 +1319,13 @@ class SwiftFileBackend extends FileBackendStore { return null; } + wfProfileIn( __METHOD__. "-{$this->name}-miss" ); list( $rcode, $rdesc, $rhdrs, $rbody, $rerr ) = $this->http->run( array( 'method' => 'HEAD', 'url' => $this->storageUrl( $auth, $container ), 'headers' => $this->authTokenHeaders( $auth ) ) ); + wfProfileOut( __METHOD__ . "-{$this->name}-miss" ); if ( $rcode === 204 ) { $stat = array( -- 2.20.1