IProfiler
in
This interface allows to interact with the built-in Nextcloud profiler.
Tags
Table of Contents
Methods
- add() : void
- Add a new data collector to the profiler. This allows to later on collect all the data from every registered collector.
- clear() : void
- Clear the stored profiles
- collect() : IProfile
- Collect all the information from the current request and construct a IProfile from it.
- dataProviders() : array<string|int, string>
- Get the list of data providers by identifier
- find() : array<string|int, mixed>
- Find a profile from various search parameters
- isEnabled() : bool
- Check if the profiler is enabled.
- loadProfile() : IProfile|null
- Load a profile from the response token
- loadProfileFromResponse() : IProfile|null
- Load a profile from a response object
- saveProfile() : bool
- Save a profile on the disk. This allows to later load it again in the profiler user interface.
- setEnabled() : void
- Set if the profiler is enabled.
Methods
add()
Add a new data collector to the profiler. This allows to later on collect all the data from every registered collector.
public
add(IDataCollector $dataCollector) : void
Parameters
- $dataCollector : IDataCollector
Tags
clear()
Clear the stored profiles
public
clear() : void
Tags
collect()
Collect all the information from the current request and construct a IProfile from it.
public
collect(Request $request, Response $response) : IProfile
Parameters
- $request : Request
- $response : Response
Tags
Return values
IProfiledataProviders()
Get the list of data providers by identifier
public
dataProviders() : array<string|int, string>
Tags
Return values
array<string|int, string>find()
Find a profile from various search parameters
public
find(string|null $url, int|null $limit, string|null $method, int|null $start, int|null $end[, string|null $statusCode = null ]) : array<string|int, mixed>
Parameters
- $url : string|null
- $limit : int|null
- $method : string|null
- $start : int|null
- $end : int|null
- $statusCode : string|null = null
Tags
Return values
array<string|int, mixed>isEnabled()
Check if the profiler is enabled.
public
isEnabled() : bool
If it is not enabled, data provider shouldn't be created and shouldn't collect any data.
Tags
Return values
boolloadProfile()
Load a profile from the response token
public
loadProfile(string $token) : IProfile|null
Parameters
- $token : string
Tags
Return values
IProfile|nullloadProfileFromResponse()
Load a profile from a response object
public
loadProfileFromResponse(Response $response) : IProfile|null
Parameters
- $response : Response
Tags
Return values
IProfile|nullsaveProfile()
Save a profile on the disk. This allows to later load it again in the profiler user interface.
public
saveProfile(IProfile $profile) : bool
Parameters
- $profile : IProfile
Tags
Return values
boolsetEnabled()
Set if the profiler is enabled.
public
setEnabled(bool $enabled) : void
Parameters
- $enabled : bool