MediaWiki
1.23.2
|
Public Member Functions | |
__construct ( $params) | |
calltreeCount ( $stack, $start) | |
Counts the number of profiled function calls sitting under the given point in the call graph. More... | |
close () | |
Close opened profiling sections. More... | |
debug ( $s) | |
Add an entry in the debug log file. More... | |
debugGroup ( $group, $s) | |
Add an entry in the debug log group. More... | |
getCallTree () | |
Returns a tree of function call instead of a list of functions. More... | |
getCallTreeLine ( $entry) | |
Callback to get a formatted line for the call tree. More... | |
getCurrentSection () | |
Get the function name of the current profiling section. More... | |
getFunctionReport () | |
Returns a list of profiled functions. More... | |
getOutput () | |
Returns a profiling output to be stored in debug file. More... | |
getProfileID () | |
getRawData () | |
getTime ( $metric=false) | |
Get the initial time of the request, based either on $wgRequestTime or $wgRUstart. More... | |
isPersistent () | |
Return whether this profiler stores data. More... | |
isStub () | |
Return whether this a stub profiler. More... | |
logData () | |
Log the whole profiling data into the database. More... | |
profileIn ( $functionname) | |
Called by wfProfieIn() More... | |
profileOut ( $functionname) | |
Called by wfProfieOut() More... | |
remapCallTree ( $stack) | |
Recursive function the format the current profiling array into a tree. More... | |
setProfileID ( $id) | |
setTemplated ( $t) | |
Mark this call as templated or not. More... | |
transactionWritingIn ( $server, $db) | |
Mark a DB as in a transaction with one or more writes pending. More... | |
transactionWritingOut ( $server, $db) | |
Mark a DB as no longer in a transaction. More... | |
Static Public Member Functions | |
static | instance () |
Singleton. More... | |
static | setInstance (Profiler $p) |
Set the profiler to a specific profiler instance. More... | |
Public Attributes | |
$mCalls = array() | |
$mCollated = array() | |
$mCollateDone = false | |
$mPeriods = array() | |
$mTemplated = false | |
$mTotals = array() | |
$mWorkStack = array() | |
Static Public Attributes | |
static | $__instance = null |
Protected Member Functions | |
addInitialStack () | |
Add the inital item in the stack. More... | |
collateData () | |
getContentType () | |
Get the content type sent out to the client. More... | |
getInitialTime ( $metric=false) | |
Get the initial time of the request, based either on $wgRequestTime or $wgRUstart. More... | |
updateTrxProfiling ( $method, $realtime) | |
Register the name and time of a method for slow DB trx detection. More... | |
Static Protected Member Functions | |
static | calculateOverhead ( $profileCount) |
Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead. More... | |
Protected Attributes | |
$mDBLockThreshold = 5.0 | |
$mDBTrxHoldingLocks = array() | |
$mDBTrxMethodTimes = array() | |
$mProfileID = false | |
$mStack = array() | |
$mTimeMetric = 'wall' | |
Definition at line 97 of file Profiler.php.
Profiler::__construct | ( | $params | ) |
Reimplemented in ProfilerSimpleText.
Definition at line 112 of file Profiler.php.
References $params, and addInitialStack().
|
protected |
Add the inital item in the stack.
Reimplemented in ProfilerSimple.
Definition at line 188 of file Profiler.php.
References array(), getInitialTime(), getTime(), and profileIn().
Referenced by __construct().
|
staticprotected |
Dummy calls to wfProfileIn/wfProfileOut to calculate its overhead.
Definition at line 649 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 667 of file Profiler.php.
References $count.
Referenced by collateData().
Profiler::close | ( | ) |
Close opened profiling sections.
Reimplemented in ProfilerStub.
Definition at line 253 of file Profiler.php.
References profileOut().
Referenced by collateData(), ProfilerSimpleUDP\logData(), ProfilerSimpleText\logData(), and ProfilerMwprof\logData().
|
protected |
Definition at line 499 of file Profiler.php.
References $fname, array(), as, calculateOverhead(), calltreeCount(), and close().
Referenced by getFunctionReport(), getRawData(), and logData().
Profiler::debug | ( | $s | ) |
Add an entry in the debug log file.
string | $s | to output |
Definition at line 752 of file Profiler.php.
Referenced by ProfilerSimple\profileIn(), profileIn(), ProfilerSimpleTrace\profileOut(), ProfilerSimple\profileOut(), and profileOut().
Profiler::debugGroup | ( | $group, | |
$s | |||
) |
Add an entry in the debug log group.
string | $group | Group to send the message to |
string | $s | to output |
Definition at line 764 of file Profiler.php.
References $s, and wfDebugLog().
Referenced by ProfilerMwprof\profileOut(), ProfilerSimple\profileOut(), profileOut(), and transactionWritingOut().
Profiler::getCallTree | ( | ) |
Returns a tree of function call instead of a list of functions.
Definition at line 369 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 418 of file Profiler.php.
|
protected |
Get the content type sent out to the client.
Used for profilers that output instead of store data.
Definition at line 775 of file Profiler.php.
References as.
Referenced by ProfilerSimpleText\logData(), and ProfilerSimpleTrace\logData().
Profiler::getCurrentSection | ( | ) |
Get the function name of the current profiling section.
Reimplemented in ProfilerStub.
Definition at line 742 of file Profiler.php.
Profiler::getFunctionReport | ( | ) |
Returns a list of profiled functions.
Reimplemented in ProfilerSimple, and ProfilerMwprof.
Definition at line 582 of file Profiler.php.
References $fname, $total, as, and collateData().
Referenced by getOutput().
|
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 471 of file Profiler.php.
References $mTimeMetric, $time, $wgRequestTime, and global.
Referenced by ProfilerSimple\addInitialStack(), and addInitialStack().
Profiler::getOutput | ( | ) |
Returns a profiling output to be stored in debug file.
Reimplemented in ProfilerStub.
Definition at line 350 of file Profiler.php.
References getCallTree(), getFunctionReport(), and global.
Profiler::getProfileID | ( | ) |
Definition at line 177 of file Profiler.php.
References $mProfileID, and wfWikiID().
Referenced by ProfilerSimpleUDP\logData().
Profiler::getRawData | ( | ) |
Reimplemented in ProfilerSimple, and ProfilerStub.
Definition at line 618 of file Profiler.php.
References $fname, $total, array(), as, and collateData().
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 438 of file Profiler.php.
References $mTimeMetric, and $time.
Referenced by addInitialStack(), ProfilerMwprof\profileIn(), ProfilerSimple\profileIn(), profileIn(), ProfilerSimpleTrace\profileOut(), ProfilerMwprof\profileOut(), ProfilerSimple\profileOut(), and profileOut().
|
static |
Singleton.
Definition at line 127 of file Profiler.php.
References $__instance, $wgProfiler, and global.
Referenced by ProfileSection\__construct(), DatabaseBase\begin(), DatabaseBase\commit(), TestFileOpPerformance\execute(), Maintenance\finalSetup(), MWDebug\getDebugInfo(), SkinTemplate\outputPage(), DatabaseBase\query(), DatabaseBase\rollback(), wfProfileIn(), and wfProfileOut().
Profiler::isPersistent | ( | ) |
Return whether this profiler stores data.
Reimplemented in ProfilerSimple, ProfilerMwprof, ProfilerStub, and ProfilerSimpleUDP.
Definition at line 169 of file Profiler.php.
Profiler::isStub | ( | ) |
Return whether this a stub profiler.
Reimplemented in ProfilerStub.
Definition at line 159 of file Profiler.php.
Profiler::logData | ( | ) |
Log the whole profiling data into the database.
Reimplemented in ProfilerMwprof, ProfilerSimple, ProfilerSimpleTrace, ProfilerSimpleText, ProfilerStub, and ProfilerSimpleUDP.
Definition at line 679 of file Profiler.php.
References $e, $name, array(), as, collateData(), DB_MASTER, global, wfGetDB(), wfHostname(), and wfReadOnly().
Profiler::profileIn | ( | $functionname | ) |
Called by wfProfieIn()
$functionname | String |
Reimplemented in ProfilerMwprof, ProfilerSimple, ProfilerSimpleTrace, and ProfilerStub.
Definition at line 204 of file Profiler.php.
References array(), debug(), getTime(), and global.
Referenced by addInitialStack().
Profiler::profileOut | ( | $functionname | ) |
Called by wfProfieOut()
$functionname | String |
Reimplemented in ProfilerMwprof, ProfilerSimple, ProfilerSimpleTrace, and ProfilerStub.
Definition at line 218 of file Profiler.php.
References $time, array(), debug(), debugGroup(), getTime(), global, and updateTrxProfiling().
Referenced by close().
Profiler::remapCallTree | ( | $stack | ) |
Recursive function the format the current profiling array into a tree.
array | $stack | profiling array |
Definition at line 379 of file Profiler.php.
References $output, array(), and as.
Referenced by getCallTree().
|
static |
Set the profiler to a specific profiler instance.
Mostly for dumpHTML
$p | Profiler object |
Definition at line 150 of file Profiler.php.
Referenced by TestFileOpPerformance\execute(), and Maintenance\finalSetup().
Profiler::setProfileID | ( | $id | ) |
Definition at line 173 of file Profiler.php.
Profiler::setTemplated | ( | $t | ) |
Mark this call as templated or not.
$t | Boolean |
Definition at line 341 of file Profiler.php.
References $t.
Profiler::transactionWritingIn | ( | $server, | |
$db | |||
) |
Mark a DB as in a transaction with one or more writes pending.
Note that there can be multiple connections to a single DB.
string | $server | DB server |
string | $db | DB name |
Reimplemented in ProfilerStub.
Definition at line 267 of file Profiler.php.
Profiler::transactionWritingOut | ( | $server, | |
$db | |||
) |
Mark a DB as no longer in a transaction.
This will check if locks are possibly held for longer than needed and log any affected transactions to a special DB log. Note that there can be multiple connections to a single DB.
string | $server | DB server |
string | $db | DB name |
Reimplemented in ProfilerStub.
Definition at line 311 of file Profiler.php.
References $name, as, debugGroup(), and list.
|
protected |
Register the name and time of a method for slow DB trx detection.
string | $method | Function name |
float | $realtime | Wal time ellapsed |
Definition at line 283 of file Profiler.php.
References $name, array(), and as.
Referenced by ProfilerSimpleTrace\profileOut(), ProfilerMwprof\profileOut(), ProfilerSimple\profileOut(), and profileOut().
|
static |
Definition at line 110 of file Profiler.php.
Referenced by ProfileSection\__construct(), ProfileSection\__destruct(), instance(), wfProfileIn(), and wfProfileOut().
Profiler::$mCalls = array() |
Definition at line 99 of file Profiler.php.
Profiler::$mCollated = array() |
Definition at line 98 of file Profiler.php.
Profiler::$mCollateDone = false |
Definition at line 101 of file Profiler.php.
|
protected |
Definition at line 103 of file Profiler.php.
|
protected |
Definition at line 105 of file Profiler.php.
|
protected |
Definition at line 107 of file Profiler.php.
Profiler::$mPeriods = array() |
Definition at line 99 of file Profiler.php.
|
protected |
Definition at line 101 of file Profiler.php.
Referenced by getProfileID().
|
protected |
Definition at line 98 of file Profiler.php.
Profiler::$mTemplated = false |
Definition at line 101 of file Profiler.php.
|
protected |
Definition at line 100 of file Profiler.php.
Referenced by getInitialTime(), and getTime().
Profiler::$mTotals = array() |
Definition at line 99 of file Profiler.php.
Profiler::$mWorkStack = array() |
Definition at line 98 of file Profiler.php.