PHP Class Elgg\Profiler

Show file Open project: elgg/elgg

Public Properties

Property Type Description
$duration_format
$minimum_percentage
$percentage_format

Public Methods

Method Description
buildTree ( Timer $timer ) : array Return a tree of time periods from a Timer
flattenTree ( array &$list = [], array $tree, string $prefix = '' ) : void Turn the tree of times into a sorted list
formatTree ( array $tree ) : array Nicely format the elapsed time values
handlePageOutput ( string $hook, string $type, string $html, array $params ) : string Append a SCRIPT element to the page output

Private Methods

Method Description
analyzePeriod ( string $name, array $times ) : array | boolean Analyze a time period
diffMicrotime ( string $start, string $end ) : float Calculate a precise time difference.
findBeginTime ( array $times ) : string | false Get the microtime start time
findEndTime ( array $times ) : string | false Get the microtime end time

Method Details

buildTree() public method

Return a tree of time periods from a Timer
public buildTree ( Timer $timer ) : array
$timer Timer Timer object
return array

flattenTree() public method

Turn the tree of times into a sorted list
public flattenTree ( array &$list = [], array $tree, string $prefix = '' ) : void
$list array
$tree array Result of buildTree()
$prefix string Prefix of period string. Leave empty.
return void

formatTree() public method

Nicely format the elapsed time values
public formatTree ( array $tree ) : array
$tree array Result of buildTree()
return array

handlePageOutput() public static method

Append a SCRIPT element to the page output
public static handlePageOutput ( string $hook, string $type, string $html, array $params ) : string
$hook string "output"
$type string "page"
$html string Full page HTML
$params array Hook params
return string

Property Details

$duration_format public property

public $duration_format

$minimum_percentage public property

public $minimum_percentage

$percentage_format public property

public $percentage_format