Support for database profiling, profiling bracket in ParserCache.php

This commit is contained in:
Tim Starling 2004-05-28 05:45:13 +00:00
parent 6769ea37c9
commit 727d419e7e
2 changed files with 9 additions and 2 deletions

View file

@ -235,7 +235,7 @@ function logProfilingData()
list( $usec, $sec ) = explode( " ", $wgRequestTime );
$start = (float)$sec + (float)$usec;
$elapsed = $now - $start;
if ( "" != $wgDebugLogFile ) {
if ( $wgProfiling ) {
$prof = wfGetProfilingOutput( $start, $elapsed );
$forward = "";
if( !empty( $_SERVER['HTTP_X_FORWARDED_FOR'] ) )
@ -251,7 +251,9 @@ function logProfilingData()
$log = sprintf( "%s\t%04.3f\t%s\n",
gmdate( "YmdHis" ), $elapsed,
urldecode( $_SERVER['REQUEST_URI'] . $forward ) );
error_log( $log . $prof, 3, $wgDebugLogFile );
if ( "" != $wgDebugLogFile ) {
error_log( $log . $prof, 3, $wgDebugLogFile );
}
}
}

View file

@ -12,6 +12,9 @@ class ParserCache
function get( &$article, &$user ) {
global $wgMemc;
$fname = "ParserCache::get";
wfProfileIn( $fname );
$hash = $user->getPageRenderingHash();
$pageid = intval( $article->getID() );
$key = $this->getKey( $article, $user );
@ -25,6 +28,8 @@ class ParserCache
} else {
$value = false;
}
wfProfileOut( $fname );
return $value;
}