38 return $this->sprofiler->scopedProfileIn( $section );
45 return $this->sprofiler->getFunctionStats();
70 usort( $data,
static function ( $a, $b ) {
71 return $b[
'real'] <=> $a[
'real'];
75 $nameWidth = $width - 65;
76 $format =
"%-{$nameWidth}s %6d %9d %9d %9d %9d %7.3f%% %9d";
78 $out[] = sprintf(
"%-{$nameWidth}s %6s %9s %9s %9s %9s %7s %9s",
79 'Name',
'Calls',
'Total',
'Min',
'Each',
'Max',
'%',
'Mem'
81 foreach ( $data as $stats ) {
82 $out[] = sprintf( $format,
85 $stats[
'real'] * 1000,
86 $stats[
'min_real'] * 1000,
87 $stats[
'real'] / $stats[
'calls'] * 1000,
88 $stats[
'max_real'] * 1000,
93 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 shared functionality.
array $params
All of the params passed from $wgProfiler.
Arbitrary section name based PHP profiling.