<?php
/**
+ * @defgroup Profiler Profiler
+ *
+ * @file
+ * @ingroup Profiler
* This file is only included if profiling is enabled
- * @addtogroup Profiler
*/
/** backward compatibility */
}
/**
- * Closed opened profiling section
+ * Close opened profiling sections
*/
function wfProfileClose() {
global $wgProfiler;
}
/**
+ * @ingroup Profiler
* @todo document
- * @addtogroup Profiler
*/
class Profiler {
var $mStack = array (), $mWorkStack = array (), $mCollated = array ();
/**
* Called by wfProfieIn()
- * @param string $functionname
+ * @param $functionname string
*/
function profileIn( $functionname ) {
global $wgDebugFunctionEntry;
/**
* Called by wfProfieOut()
- * @param string $functionname
+ * @param $functionname string
*/
function profileOut($functionname) {
global $wgDebugFunctionEntry;
/**
* Recursive function the format the current profiling array into a tree
*
- * @param array $stack profiling array
+ * @param $stack profiling array
*/
function remapCallTree( $stack ) {
if( count( $stack ) < 2 ){
/**
* Log a function into the database.
*
- * @param string $name function name
- * @param float $timeSum
- * @param int $eventCount number of times that function was called
+ * @param $name string: function name
+ * @param $timeSum float
+ * @param $eventCount int: number of times that function was called
*/
static function logToDB( $name, $timeSum, $eventCount, $memorySum ){
# Do not log anything if database is readonly (bug 5375)
if( wfReadOnly() ) { return; }
- # Warning: $wguname is a live patch, it should be moved to Setup.php
- global $wguname, $wgProfilePerHost;
+ global $wgProfilePerHost;
$dbw = wfGetDB( DB_MASTER );
if( !is_object( $dbw ) )
$name = substr($name, 0, 255);
if( $wgProfilePerHost ){
- $pfhost = $wguname['nodename'];
+ $pfhost = wfHostname();
} else {
$pfhost = '';
}
/**
* Get function caller
- * @param int $level
+ * @param $level int
*/
static function getCaller( $level ) {
$backtrace = wfDebugBacktrace();
/**
* Add an entry in the debug log file
- * @param string $s string to output
+ * @param $s string to output
*/
function debug( $s ) {
if( function_exists( 'wfDebug' ) ) {