MediaWiki REL1_35
Xhprof Class Reference

Convenience class for working with XHProf https://github.com/phacility/xhprof. More...

Static Public Member Functions

static disable ()
 Stop xhprof profiler.
 
static enable ( $flags=0, $options=[])
 Start xhprof profiler.
 
static isEnabled ()
 Start xhprof profiler.
 

Static Protected Member Functions

static callAny (array $functions, array $args=[])
 Call the first available function from $functions.
 

Static Protected Attributes

static bool $enabled
 Whether XHProf is currently running.
 

Detailed Description

Convenience class for working with XHProf https://github.com/phacility/xhprof.

XHProf can be installed via PECL.

This also supports using the Tideways profiler https://github.com/tideways/php-xhprof-extension.

Since
1.28

Definition at line 30 of file Xhprof.php.

Member Function Documentation

◆ callAny()

static Xhprof::callAny ( array  $functions,
array  $args = [] 
)
staticprotected

Call the first available function from $functions.

Parameters
array$functions
array$args
Returns
mixed
Exceptions
Exception

Definition at line 96 of file Xhprof.php.

References $args.

Referenced by disable(), and enable().

◆ disable()

static Xhprof::disable ( )
static

Stop xhprof profiler.

Returns
array|null xhprof data from the run, or null if xhprof was not running.

Definition at line 76 of file Xhprof.php.

References callAny().

Referenced by ProfilerXhprof\getXhprofData().

◆ enable()

static Xhprof::enable (   $flags = 0,
  $options = [] 
)
static

Start xhprof profiler.

Parameters
int$flags
array$options
Exceptions
Exception

Definition at line 50 of file Xhprof.php.

References $args, and callAny().

Referenced by ProfilerXhprof\__construct().

◆ isEnabled()

static Xhprof::isEnabled ( )
static

Start xhprof profiler.

Returns
bool

Definition at line 40 of file Xhprof.php.

References $enabled.

Member Data Documentation

◆ $enabled

bool Xhprof::$enabled
staticprotected

Whether XHProf is currently running.

Definition at line 34 of file Xhprof.php.

Referenced by isEnabled().


The documentation for this class was generated from the following file: