interface ProfilerInterface (View source)

Interface ProfilerInterface

Methods

string
getName()

Get the name of this profiler.

mark(string $name)

Mark a profile point.

boolean
hasPoint(string $name)

Check if the profiler has marked the given point.

ProfilerPointInterface
getPoint(string $name)

Get the point identified by the given name.

float
getTimeBetween(string $first, string $second)

Get the elapsed time in seconds between the two points.

integer
getMemoryBetween(string $first, string $second)

Get the amount of allocated memory in bytes between the two points.

integer
getMemoryPeakBytes()

Get the memory peak in bytes during the profiler run.

ProfilerPointInterface[]
getPoints()

Get the points in this profiler (from the first to the last).

string
render()

Render the profiler.

Details

at line line 24
string getName()

Get the name of this profiler.

Return Value

string The name of this profiler.

at line line 35
ProfilerInterface mark(string $name)

Mark a profile point.

Parameters

string $name The profile point name.

Return Value

ProfilerInterface This method is chainable.

Exceptions

InvalidArgumentException If the point already exists.

at line line 44
boolean hasPoint(string $name)

Check if the profiler has marked the given point.

Parameters

string $name The name of the point.

Return Value

boolean True if the profiler has marked the point, false otherwise.

at line line 53
ProfilerPointInterface getPoint(string $name)

Get the point identified by the given name.

Parameters

string $name The name of the point.

Return Value

ProfilerPointInterface The profile point or the default value.

at line line 65
float getTimeBetween(string $first, string $second)

Get the elapsed time in seconds between the two points.

Parameters

string $first The name of the first point.
string $second The name of the second point.

Return Value

float The elapsed time between these points in seconds.

Exceptions

LogicException If the points were not marked.

at line line 77
integer getMemoryBetween(string $first, string $second)

Get the amount of allocated memory in bytes between the two points.

Parameters

string $first The name of the first point.
string $second The name of the second point.

Return Value

integer The amount of allocated memory between these points in bytes.

Exceptions

LogicException If the points were not marked.

at line line 83
integer getMemoryPeakBytes()

Get the memory peak in bytes during the profiler run.

Return Value

integer The memory peak in bytes.

at line line 90
ProfilerPointInterface[] getPoints()

Get the points in this profiler (from the first to the last).

Return Value

ProfilerPointInterface[] An array of points in this profiler.

at line line 97
string render()

Render the profiler.

Return Value

string The rendered profiler.