Class for profiling requests.

This resources requires that you have the xhprof module enabled on your Apache web server. It's also easiest to use when you have the mod rewrite module enabled Syntax LudoDBProfiling/resourceToProfile/arg1/arg2/resourceServiceToProfile/profile i.e first argument is LudoDBProfiling and last argument should be profile. The arguments in between is the request you want to profile, example

http://localhost/LudoDBProfiling/Person/1/read/profile
package LudoDB

 Methods

Construct new instance

__construct() 

End profiling

end() : null | string

Returns

nullstring

Return empty string on successful profiling.

getOnSuccessMessageFor(String $service) : String

Parameters

$service

String

Returns

String

Return elapsed time.

getTimeUsage() : mixed

Returns

mixed

Returning "profile" as only valid service method

getValidServices() : array

Returns

array

Start profiling.

profile(array $data) : array

Parameters

$data

array

Exceptions

\LudoDBException

Returns

array

No caching

shouldCache($service) : bool

When true a serialized version of LudoDBModel::read will be stored in a caching table. When caching is enabled, you should also implement clearCache() to clear cache in case Data has been changed.

Parameters

$service

Returns

bool

Start profiling.

start($name) 

Parameters

$name

Exceptions

\LudoDBException

Number of arguments has to be equal or bigger than 2 (resource + service name).

validateArguments(String $service, Array $arguments) : bool

Parameters

$service

String

$arguments

Array

Returns

bool

Validate service data

validateServiceData(string $service, array $data) : bool

Parameters

$service

string

$data

array

Returns

bool

Return path to xhprof

getPath() : string

Returns

string

 Properties

 

$arguments : array
 

$name : string
 

$start : int