From: Tim Starling Date: Tue, 28 Mar 2006 05:11:40 +0000 (+0000) Subject: Optionally use a different profile name for master queries X-Git-Tag: 1.6.0~94 X-Git-Url: http://git.cyclocoop.org/%22.%24h.%22?a=commitdiff_plain;h=bad435556d3dab0660912ade26367e68c2ae47c1;p=lhc%2Fweb%2Fwiklou.git Optionally use a different profile name for master queries --- diff --git a/includes/Database.php b/includes/Database.php index 59817b2a8c..138792dac8 100644 --- a/includes/Database.php +++ b/includes/Database.php @@ -367,10 +367,16 @@ class Database { # Who's been wasting my precious column space? -- TS #$profName = 'query: ' . $fname . ' ' . substr( Database::generalizeSQL( $sql ), 0, 255 ); - $profName = 'query: ' . substr( Database::generalizeSQL( $sql ), 0, 255 ); - wfProfileIn( 'Database::query' ); - wfProfileIn( $profName ); + if ( is_null( $this->getLBInfo( 'master' ) ) ) { + $queryProf = 'query: ' . substr( Database::generalizeSQL( $sql ), 0, 255 ); + $totalProf = 'Database::query'; + } else { + $queryProf = 'query-m: ' . substr( Database::generalizeSQL( $sql ), 0, 255 ); + $totalProf = 'Database::query-master'; + } + wfProfileIn( $totalProf ); + wfProfileIn( $queryProf ); } $this->mLastQuery = $sql; @@ -414,8 +420,8 @@ class Database { } if ( $wgProfiling ) { - wfProfileOut( $profName ); - wfProfileOut( 'Database::query' ); + wfProfileOut( $queryProf ); + wfProfileOut( $totalProf ); } return $ret; }