From bad435556d3dab0660912ade26367e68c2ae47c1 Mon Sep 17 00:00:00 2001 From: Tim Starling Date: Tue, 28 Mar 2006 05:11:40 +0000 Subject: [PATCH] Optionally use a different profile name for master queries --- includes/Database.php | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) 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; } -- 2.20.1