Class Profiler
Profiler take snapshots of runtime and overall memory footprint.
Profiler instances can be named and are accessed via the Core\Profiler::instance()
method. A default instance with the name given by the constant
Profiler::CoreProfile is used by the framework to measure it's own
boot time and memory footprint, if configured accordingly.
If the default instance is used for additional measurements, state names
should not start with a colon (":") to avoid collisions with
framework-internal state names.
The profiler does not inherit from Core\Object
and does not support KVC
access. This allows the profiler to be used at early boot stages where no
other modules have yet been loaded. Access to properties is manually
implemented to emulate KVC usage.
Methods summary
public
|
|
public
mixed
|
|
public static
|
|
public
array
|
#
memState( string $stateName, string $compareStateName = null )
Sets a new named memory state or returns the difference between two named states. |
public
float
|
#
timeState( string $stateName, string $compareStateName = null )
Sets a new named time state or returns the difference between two named states. |
Constants summary
string |
CoreProfile
Name of profiler used for internal measurements. |
#
'__xc'
|
string |
CoreBootState
State name for the core boot initialisation timestamp. |
#
':core-boot'
|
string |
CoreLoadState
State name for the timestamp after core startup is finished. |
#
':core-load'
|
integer |
MicroTimeMethod
Uses micro-time measurement to get time states. Default method. |
#
0x1
|
Properties summary
protected
array
|
$_memStates
Associative array of stored memory states. |
|
protected
array
|
$_timeStates
Associative array of stored time states. |
|
protected
integer
|
$_timeMethod
Current time measurement method. |
Magic properties
public read-only
array
|
$memStates
Associative array of stored memory states. |
public read-only
array
|
$timeStates
Associative array of stored time states. |
public read-only
integer
|
$timeMethod
Current time measurement method. |