MediaWiki
REL1_21
|
Public Member Functions | |
__construct ($params) | |
calltreeCount ($stack, $start) | |
Counts the number of profiled function calls sitting under the given point in the call graph. | |
close () | |
Close opened profiling sections. | |
debug ($s) | |
Add an entry in the debug log file. | |
getCallTree () | |
Returns a tree of function call instead of a list of functions. | |
getCallTreeLine ($entry) | |
Callback to get a formatted line for the call tree. | |
getCurrentSection () | |
Get the function name of the current profiling section. | |
getFunctionReport () | |
Returns a list of profiled functions. | |
getOutput () | |
Returns a profiling output to be stored in debug file. | |
getProfileID () | |
getTime ($metric=false) | |
Get the initial time of the request, based either on $wgRequestTime or $wgRUstart. | |
isPersistent () | |
Return whether this profiler stores data. | |
isStub () | |
Return whether this a stub profiler. | |
logData () | |
Log the whole profiling data into the database. | |
profileIn ($functionname) | |
Called by wfProfieIn() | |
profileOut ($functionname) | |
Called by wfProfieOut() | |
remapCallTree ($stack) | |
Recursive function the format the current profiling array into a tree. | |
setProfileID ($id) | |
setTemplated ($t) | |
Mark this call as templated or not. | |
Static Public Member Functions | |
static | instance () |
Singleton. | |
static | setInstance (Profiler $p) |
Set the profiler to a specific profiler instance. | |
Public Attributes | |
$mCalls = array () | |
$mCollated = array () | |
$mCollateDone = false | |
$mTemplated = false | |
$mTotals = array () | |
$mWorkStack = array () | |
Protected Member Functions | |
addInitialStack () | |
Add the inital item in the stack. | |
collateData () | |
getContentType () | |
Get the content type sent out to the client. | |
getInitialTime ($metric=false) | |
Get the initial time of the request, based either on $wgRequestTime or $wgRUstart. | |
Static Protected Member Functions | |
static | calculateOverhead ($profileCount) |
Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead. | |
Protected Attributes | |
$mProfileID = false | |
$mStack = array() | |
$mTimeMetric = 'wall' | |
Static Private Attributes | |
static | $__instance = null |
Definition at line 55 of file Profiler.php.
Profiler::__construct | ( | $ | params | ) |
Reimplemented in ProfilerSimpleText.
Definition at line 62 of file Profiler.php.
References $params, and addInitialStack().
Profiler::addInitialStack | ( | ) | [protected] |
Add the inital item in the stack.
Reimplemented in ProfilerSimple.
Definition at line 142 of file Profiler.php.
References array(), getInitialTime(), getTime(), and profileIn().
Referenced by __construct().
static Profiler::calculateOverhead | ( | $ | profileCount | ) | [static, protected] |
Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead.
Definition at line 484 of file Profiler.php.
References wfProfileIn(), and wfProfileOut().
Referenced by collateData().
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.
$stack | Array: |
$start | Integer: |
Definition at line 502 of file Profiler.php.
References $count.
Referenced by collateData().
Profiler::close | ( | ) |
Close opened profiling sections.
Reimplemented in ProfilerStub.
Definition at line 207 of file Profiler.php.
References profileOut().
Referenced by collateData(), ProfilerSimpleUDP\logData(), and ProfilerSimpleText\logData().
Profiler::collateData | ( | ) | [protected] |
Definition at line 376 of file Profiler.php.
References $fname, array(), as, calculateOverhead(), calltreeCount(), and close().
Referenced by getFunctionReport(), and logData().
Profiler::debug | ( | $ | s | ) |
Add an entry in the debug log file.
string | $s | to output |
Definition at line 587 of file Profiler.php.
Referenced by ProfilerSimple\profileIn(), profileIn(), ProfilerSimpleTrace\profileOut(), ProfilerSimple\profileOut(), and profileOut().
Returns a tree of function call instead of a list of functions.
Definition at line 246 of file Profiler.php.
References array(), and remapCallTree().
Referenced by getOutput().
Profiler::getCallTreeLine | ( | $ | entry | ) |
Callback to get a formatted line for the call tree.
Definition at line 295 of file Profiler.php.
Profiler::getContentType | ( | ) | [protected] |
Get the content type sent out to the client.
Used for profilers that output instead of store data.
Definition at line 598 of file Profiler.php.
References as.
Referenced by ProfilerSimpleText\logData(), and ProfilerSimpleTrace\logData().
Get the function name of the current profiling section.
Reimplemented in ProfilerStub.
Definition at line 577 of file Profiler.php.
Returns a list of profiled functions.
Reimplemented in ProfilerSimple.
Definition at line 458 of file Profiler.php.
References $fname, $total, as, and collateData().
Referenced by getOutput().
Profiler::getInitialTime | ( | $ | metric = false | ) | [protected] |
Get the initial time of the request, based either on $wgRequestTime or $wgRUstart.
Will return null if not able to find data.
string | false | $metric | metric to use, with the following possibilities:
|
Definition at line 348 of file Profiler.php.
References $time, $wgRequestTime, empty, and global.
Referenced by ProfilerSimple\addInitialStack(), addInitialStack(), and ProfilerSimple\getCpuTime().
Returns a profiling output to be stored in debug file.
Reimplemented in ProfilerStub.
Definition at line 227 of file Profiler.php.
References getCallTree(), getFunctionReport(), and global.
Definition at line 131 of file Profiler.php.
References wfWikiID().
Referenced by ProfilerSimpleUDP\logData().
Profiler::getTime | ( | $ | metric = false | ) |
Get the initial time of the request, based either on $wgRequestTime or $wgRUstart.
Will return null if not able to find data.
string | false | $metric | metric to use, with the following possibilities:
|
Definition at line 315 of file Profiler.php.
References $time.
Referenced by addInitialStack(), ProfilerSimple\getCpuTime(), ProfilerSimple\profileIn(), profileIn(), ProfilerSimpleTrace\profileOut(), ProfilerSimple\profileOut(), and profileOut().
static Profiler::instance | ( | ) | [static] |
Singleton.
Definition at line 77 of file Profiler.php.
References $__instance, $wgProfiler, global, and wfDebug().
Referenced by ApiBase\dieUsage(), TestFileOpPerformance\execute(), SkinTemplate\outputPage(), wfLogProfilingData(), wfProfileIn(), and wfProfileOut().
Return whether this profiler stores data.
Reimplemented in ProfilerSimple, ProfilerStub, and ProfilerSimpleUDP.
Definition at line 123 of file Profiler.php.
Profiler::isStub | ( | ) |
Return whether this a stub profiler.
Reimplemented in ProfilerStub.
Definition at line 113 of file Profiler.php.
Log the whole profiling data into the database.
Reimplemented in ProfilerSimple, ProfilerSimpleTrace, ProfilerSimpleText, ProfilerStub, and ProfilerSimpleUDP.
Definition at line 514 of file Profiler.php.
References $name, array(), as, collateData(), global, wfGetDB(), wfHostname(), and wfReadOnly().
Profiler::profileIn | ( | $ | functionname | ) |
Called by wfProfieIn()
$functionname | String |
Reimplemented in ProfilerSimple, ProfilerStub, and ProfilerSimpleTrace.
Definition at line 158 of file Profiler.php.
References array(), debug(), getTime(), and global.
Referenced by addInitialStack().
Profiler::profileOut | ( | $ | functionname | ) |
Called by wfProfieOut()
$functionname | String |
Reimplemented in ProfilerSimple, ProfilerSimpleTrace, and ProfilerStub.
Definition at line 172 of file Profiler.php.
References $time, array(), debug(), getTime(), and global.
Referenced by close().
Profiler::remapCallTree | ( | $ | stack | ) |
Recursive function the format the current profiling array into a tree.
array | $stack | profiling array |
Definition at line 256 of file Profiler.php.
References $output, array(), and as.
Referenced by getCallTree().
static Profiler::setInstance | ( | Profiler $ | p | ) | [static] |
Set the profiler to a specific profiler instance.
Mostly for dumpHTML
$p | Profiler object |
Definition at line 104 of file Profiler.php.
Profiler::setProfileID | ( | $ | id | ) |
Definition at line 127 of file Profiler.php.
Profiler::setTemplated | ( | $ | t | ) |
Mark this call as templated or not.
$t | Boolean |
Definition at line 218 of file Profiler.php.
References $t.
Profiler::$__instance = null [static, private] |
Definition at line 60 of file Profiler.php.
Referenced by instance().
Profiler::$mCalls = array () |
Definition at line 57 of file Profiler.php.
Profiler::$mCollated = array () |
Definition at line 56 of file Profiler.php.
Profiler::$mCollateDone = false |
Definition at line 59 of file Profiler.php.
Profiler::$mProfileID = false [protected] |
Definition at line 59 of file Profiler.php.
Profiler::$mStack = array() [protected] |
Definition at line 56 of file Profiler.php.
Profiler::$mTemplated = false |
Definition at line 59 of file Profiler.php.
Profiler::$mTimeMetric = 'wall' [protected] |
Definition at line 58 of file Profiler.php.
Profiler::$mTotals = array () |
Definition at line 57 of file Profiler.php.
Profiler::$mWorkStack = array () |
Definition at line 56 of file Profiler.php.