43 return $this->sprofiler->scopedProfileIn(
$section );
50 return $this->sprofiler->getFunctionStats();
75 usort( $data,
function ( $a, $b ) {
76 if ( $a[
'real'] === $b[
'real'] ) {
79 return ( $a[
'real'] > $b[
'real'] ) ? -1 : 1;
83 $nameWidth = $width - 65;
84 $format =
"%-{$nameWidth}s %6d %9d %9d %9d %9d %7.3f%% %9d";
86 $out[] = sprintf(
"%-{$nameWidth}s %6s %9s %9s %9s %9s %7s %9s",
87 'Name',
'Calls',
'Total',
'Min',
'Each',
'Max',
'%',
'Mem'
89 foreach ( $data as $stats ) {
90 $out[] = sprintf( $format,
93 $stats[
'real'] * 1000,
94 $stats[
'min_real'] * 1000,
95 $stats[
'real'] / $stats[
'calls'] * 1000,
96 $stats[
'max_real'] * 1000,
101 return implode(
"\n",
$out );
Profiler that only tracks explicit profiling sections.
getFunctionReport()
Get a report of profiled functions sorted by inclusive wall clock time in descending order.
getFunctionStats()
Get the aggregated inclusive profiling data for each method.
SectionProfiler $sprofiler
close()
Close opened profiling sections.
getOutput()
Returns a profiling output to be stored in debug file.
__construct(array $params=[])
scopedProfileIn( $section)
Mark the start of a custom profiling frame (e.g.
Profiler base class that defines the interface and some trivial functionality.
array $params
All of the params passed from $wgProfiler.
Custom PHP profiler for parser/DB type section names that xhprof/xdebug can't handle.
this hook is for auditing only or null if authentication failed before getting that far or null if we can t even determine that probably a stub it is not rendered in wiki pages or galleries in category pages allow injecting custom HTML after the section Any uses of the hook need to handle escaping see BaseTemplate::getToolbox and BaseTemplate::makeListItem for details on the format of individual items inside of this array or by returning and letting standard HTTP rendering take place modifiable or by returning false and taking over the output $out
usually copyright or history_copyright This message must be in HTML not wikitext if the section is included from a template $section