Profiler
in package
implements
ResetInterface
Profiler.
Tags
Interfaces, Classes and Traits
- ResetInterface
- Provides a way to reset an object to its initial state.
Table of Contents
- $collectors : array<string|int, DataCollectorInterface>
- $enabled : mixed
- $initiallyEnabled : mixed
- $logger : mixed
- $storage : mixed
- __construct() : mixed
- add() : mixed
- Adds a Collector.
- all() : array<string|int, mixed>
- Gets the Collectors associated with this profiler.
- collect() : Profile|null
- Collects data for the given Response.
- disable() : mixed
- Disables the profiler.
- enable() : mixed
- Enables the profiler.
- find() : array<string|int, mixed>
- Finds profiler tokens for the given criteria.
- get() : DataCollectorInterface
- Gets a Collector by name.
- has() : bool
- Returns true if a Collector for the given name exists.
- loadProfile() : Profile|null
- Loads the Profile for the given token.
- loadProfileFromResponse() : Profile|null
- Loads the Profile for the given Response.
- purge() : mixed
- Purges all data from the storage.
- reset() : mixed
- saveProfile() : bool
- Saves a Profile.
- set() : mixed
- Sets the Collectors associated with this profiler.
- getTimestamp() : int|null
Properties
$collectors
private
array<string|int, DataCollectorInterface>
$collectors
= []
$enabled
private
mixed
$enabled
= true
$initiallyEnabled
private
mixed
$initiallyEnabled
= true
$logger
private
mixed
$logger
$storage
private
mixed
$storage
Methods
__construct()
public
__construct(ProfilerStorageInterface $storage[, LoggerInterface|null $logger = null ][, bool $enable = true ]) : mixed
Parameters
- $storage : ProfilerStorageInterface
- $logger : LoggerInterface|null = null
- $enable : bool = true
Return values
mixed —add()
Adds a Collector.
public
add(DataCollectorInterface $collector) : mixed
Parameters
- $collector : DataCollectorInterface
Return values
mixed —all()
Gets the Collectors associated with this profiler.
public
all() : array<string|int, mixed>
Return values
array<string|int, mixed> —collect()
Collects data for the given Response.
public
collect(Request $request, Response $response[, Throwable|null $exception = null ]) : Profile|null
Parameters
Return values
Profile|null —disable()
Disables the profiler.
public
disable() : mixed
Return values
mixed —enable()
Enables the profiler.
public
enable() : mixed
Return values
mixed —find()
Finds profiler tokens for the given criteria.
public
find(string|null $ip, string|null $url, int|null $limit, string|null $method, string|null $start, string|null $end[, string|null $statusCode = null ]) : array<string|int, mixed>
Parameters
- $ip : string|null
- $url : string|null
- $limit : int|null
-
The maximum number of tokens to return
- $method : string|null
- $start : string|null
-
The start date to search from
- $end : string|null
-
The end date to search to
- $statusCode : string|null = null
Tags
Return values
array<string|int, mixed> —get()
Gets a Collector by name.
public
get(string $name) : DataCollectorInterface
Parameters
- $name : string
-
A collector name
Tags
Return values
DataCollectorInterface —has()
Returns true if a Collector for the given name exists.
public
has(string $name) : bool
Parameters
- $name : string
-
A collector name
Return values
bool —loadProfile()
Loads the Profile for the given token.
public
loadProfile(string $token) : Profile|null
Parameters
- $token : string
Return values
Profile|null —loadProfileFromResponse()
Loads the Profile for the given Response.
public
loadProfileFromResponse(Response $response) : Profile|null
Parameters
- $response : Response
Return values
Profile|null —purge()
Purges all data from the storage.
public
purge() : mixed
Return values
mixed —reset()
public
reset() : mixed
Return values
mixed —saveProfile()
Saves a Profile.
public
saveProfile(Profile $profile) : bool
Parameters
- $profile : Profile
Return values
bool —set()
Sets the Collectors associated with this profiler.
public
set([array<string|int, DataCollectorInterface> $collectors = [] ]) : mixed
Parameters
- $collectors : array<string|int, DataCollectorInterface> = []
-
An array of collectors
Return values
mixed —getTimestamp()
private
getTimestamp(string|null $value) : int|null
Parameters
- $value : string|null