Profiler Class Reference
[Profiler]

Inherited by ProfilerSimple.

List of all members.

Public Member Functions

 __construct ()
 profileIn ($functionname)
 Called by wfProfieIn().
 profileOut ($functionname)
 Called by wfProfieOut().
 close ()
 called by wfProfileClose()
 getOutput ()
 called by wfGetProfilingOutput()
 getCallTree ()
 returns a tree of function call instead of a list of functions
 remapCallTree ($stack)
 Recursive function the format the current profiling array into a tree.
 getCallTreeLine ($entry)
 Callback to get a formatted line for the call tree.
 getTime ()
 getUserTime ()
 getFunctionReport ()
 Returns a list of profiled functions.
 calltreeCount ($stack, $start)
 Counts the number of profiled function calls sitting under the given point in the call graph.
 getCurrentSection ()
 Get the function name of the current profiling section.
 debug ($s)
 Add an entry in the debug log file.

Static Public Member Functions

static logToDB ($name, $timeSum, $eventCount, $memorySum)
 Log a function into the database.
static getCaller ($level)
 Get function caller.

Public Attributes

 $mStack = array ()
 $mWorkStack = array ()
 $mCollated = array ()
 $mCalls = array ()
 $mTotals = array ()


Detailed Description

Todo:
document

Definition at line 61 of file Profiler.php.


Constructor & Destructor Documentation

Profiler::__construct (  ) 

Reimplemented in ProfilerSimple, and ProfilerSimpleTrace.

Definition at line 65 of file Profiler.php.

References $wgRequestTime, and profileIn().


Member Function Documentation

Profiler::calltreeCount ( stack,
start 
)

Counts the number of profiled function calls sitting under the given point in the call graph.

Not the most efficient algo.

Parameters:
$stack Array:
$start Integer:
Returns:
Integer
Access:
private

Definition at line 340 of file Profiler.php.

References $count, $i, and $start.

Referenced by getFunctionReport().

Profiler::close (  ) 

called by wfProfileClose()

Definition at line 130 of file Profiler.php.

References profileOut().

Referenced by getOutput().

Profiler::debug ( s  ) 

Add an entry in the debug log file.

Parameters:
$s string to output

Definition at line 436 of file Profiler.php.

References $s, and wfDebug().

Referenced by ProfilerSimple::profileIn(), profileIn(), ProfilerSimpleTrace::profileOut(), ProfilerSimple::profileOut(), and profileOut().

static Profiler::getCaller ( level  )  [static]

Get function caller.

Parameters:
$level int

Definition at line 418 of file Profiler.php.

References wfDebugBacktrace().

Profiler::getCallTree (  ) 

returns a tree of function call instead of a list of functions

Definition at line 163 of file Profiler.php.

References remapCallTree().

Referenced by getOutput().

Profiler::getCallTreeLine ( entry  ) 

Callback to get a formatted line for the call tree.

Definition at line 210 of file Profiler.php.

References $end, $fname, $space, and $start.

Profiler::getCurrentSection (  ) 

Get the function name of the current profiling section.

Definition at line 409 of file Profiler.php.

Profiler::getFunctionReport (  ) 

Returns a list of profiled functions.

Also log it into the database if $wgProfileToDatabase is set to true.

Reimplemented in ProfilerSimple, ProfilerSimpleText, and ProfilerSimpleUDP.

Definition at line 233 of file Profiler.php.

References $end, $fname, $i, $start, $total, $wgProfileToDatabase, calltreeCount(), logToDB(), wfProfileIn(), and wfProfileOut().

Referenced by getOutput().

Profiler::getOutput (  ) 

Profiler::getTime (  ) 

Definition at line 219 of file Profiler.php.

Referenced by profileIn(), and profileOut().

Profiler::getUserTime (  ) 

Definition at line 224 of file Profiler.php.

static Profiler::logToDB ( name,
timeSum,
eventCount,
memorySum 
) [static]

Log a function into the database.

Parameters:
$name string: function name
$timeSum float
$eventCount int: number of times that function was called

Definition at line 356 of file Profiler.php.

References $dbw, $name, $wgProfilePerHost, wfGetDB(), wfHostname(), and wfReadOnly().

Referenced by getFunctionReport().

Profiler::profileIn ( functionname  ) 

Called by wfProfieIn().

Parameters:
$functionname string

Reimplemented in ProfilerSimple, and ProfilerSimpleTrace.

Definition at line 80 of file Profiler.php.

References $wgDebugFunctionEntry, $wgProfiling, debug(), and getTime().

Referenced by __construct().

Profiler::profileOut ( functionname  ) 

Called by wfProfieOut().

Parameters:
$functionname string

Reimplemented in ProfilerSimple, and ProfilerSimpleTrace.

Definition at line 94 of file Profiler.php.

References $wgDebugFunctionEntry, $wgProfiling, debug(), and getTime().

Referenced by close().

Profiler::remapCallTree ( stack  ) 

Recursive function the format the current profiling array into a tree.

Parameters:
$stack profiling array

Definition at line 172 of file Profiler.php.

References $i, and $output.

Referenced by getCallTree().


Member Data Documentation

Profiler::$mCalls = array ()

Definition at line 63 of file Profiler.php.

Profiler::$mCollated = array ()

Definition at line 62 of file Profiler.php.

Profiler::$mStack = array ()

Definition at line 62 of file Profiler.php.

Profiler::$mTotals = array ()

Definition at line 63 of file Profiler.php.

Profiler::$mWorkStack = array ()

Definition at line 62 of file Profiler.php.


The documentation for this class was generated from the following file:

Generated on Sat Sep 5 02:08:45 2009 for MediaWiki by  doxygen 1.5.9