|
MediaWiki master
|
Arbitrary section name based PHP profiling. More...

Public Member Functions | |
| __construct (array $params=[]) | |
| getFunctionStats () | |
| Get the aggregated inclusive profiling data for each method. | |
| profileInInternal ( $functionname) | |
| This method should not be called outside SectionProfiler. | |
| profileOutInternal ( $functionname) | |
| This method should not be called outside SectionProfiler. | |
| reset () | |
| Clear all of the profiling data for another run. | |
| scopedProfileIn ( $section) | |
| scopedProfileOut (?SectionProfileCallback &$section) | |
Protected Member Functions | |
| collateData () | |
| Populate collated data. | |
| getErrorEntry () | |
| getTime ( $metric='wall') | |
| Get the initial time of the request, based on getrusage() | |
| getZeroEntry () | |
| updateEntry ( $name, $elapsedCpu, $elapsedReal, $memChange) | |
| Update the collation entry for a given method name. | |
Protected Attributes | |
| array[] | $collated = [] |
| Map of (function name => aggregate data array) | |
| bool | $collateDone = false |
| array null | $end |
| Map of (mem,real,cpu) | |
| array | $errorEntry |
| Cache of a standard broken collation entry. | |
| LoggerInterface | $logger |
| array[] | $stack = [] |
| List of resolved profile calls with start/end data. | |
| array null | $start |
| Map of (mem,real,cpu) | |
| array | $workStack = [] |
| Queue of open profile calls with start data. | |
Arbitrary section name based PHP profiling.
This custom profiler can track code execution that doesn't cleanly map to a function call and thus can't be handled by ProfilerXhprof or ProfilerExcimer. For example, parser invocations or DB queries.
Definition at line 20 of file SectionProfiler.php.
| SectionProfiler::__construct | ( | array | $params = [] | ) |
| array | $params |
Definition at line 42 of file SectionProfiler.php.
References getErrorEntry().
|
protected |
Populate collated data.
Definition at line 254 of file SectionProfiler.php.
|
protected |
Definition at line 155 of file SectionProfiler.php.
Referenced by __construct().
| SectionProfiler::getFunctionStats | ( | ) |
Get the aggregated inclusive profiling data for each method.
The percent time for each time is based on the current "total" time used is based on all methods so far. This method can therefore be called several times in between several profiling calls without the delays in usage of the profiler skewing the results. A "-total" entry is always included in the results.
Definition at line 81 of file SectionProfiler.php.
|
protected |
Get the initial time of the request, based on getrusage()
| string | bool | $metric | Metric to use, with the following possibilities:
|
Definition at line 275 of file SectionProfiler.php.
|
protected |
Definition at line 141 of file SectionProfiler.php.
| SectionProfiler::profileInInternal | ( | $functionname | ) |
This method should not be called outside SectionProfiler.
| string | $functionname |
Definition at line 188 of file SectionProfiler.php.
Referenced by scopedProfileIn().
| SectionProfiler::profileOutInternal | ( | $functionname | ) |
This method should not be called outside SectionProfiler.
| string | $functionname |
Definition at line 216 of file SectionProfiler.php.
| SectionProfiler::reset | ( | ) |
Clear all of the profiling data for another run.
Definition at line 129 of file SectionProfiler.php.
| SectionProfiler::scopedProfileIn | ( | $section | ) |
| string | $section |
Definition at line 50 of file SectionProfiler.php.
References profileInInternal().
| SectionProfiler::scopedProfileOut | ( | ?SectionProfileCallback & | $section | ) |
Definition at line 56 of file SectionProfiler.php.
|
protected |
Update the collation entry for a given method name.
| string | $name | |
| float | $elapsedCpu | |
| float | $elapsedReal | |
| int | $memChange |
Definition at line 169 of file SectionProfiler.php.
|
protected |
Map of (function name => aggregate data array)
Definition at line 30 of file SectionProfiler.php.
|
protected |
Definition at line 32 of file SectionProfiler.php.
|
protected |
Map of (mem,real,cpu)
Definition at line 24 of file SectionProfiler.php.
|
protected |
Cache of a standard broken collation entry.
Definition at line 35 of file SectionProfiler.php.
|
protected |
Definition at line 37 of file SectionProfiler.php.
|
protected |
List of resolved profile calls with start/end data.
Definition at line 26 of file SectionProfiler.php.
|
protected |
Map of (mem,real,cpu)
Definition at line 22 of file SectionProfiler.php.
|
protected |
Queue of open profile calls with start data.
Definition at line 28 of file SectionProfiler.php.