include/SugarXHprof/SugarXHprof.php

Show: inherited
Table of Contents

\SugarXHprof

Package: SugarCRM

Class allows us to use XHprof for profiling To enable profiling you should add next properties to config_override.php

See
\SugarXHprof::$enable  
See
\SugarXHprof::$manager  
See
\SugarXHprof::$log_to  
See
\SugarXHprof::$sample_rate  
See
\SugarXHprof::$ignored_functions  
See
\SugarXHprof::$flags  

Properties

Propertyprotectedbool  $enable= 'false'
static

enable profiler or not, it will be disabled by some reasons
Default valuefalseDetails
Type
bool
See
\SugarXHprof::loadConfig()  
Propertyprotectedint  $flags= '0'
static

flags for xhprof
Default value0Details
Type
int
See
\http://www.php.net/manual/xhprof.constants.php  
Propertyprotectedarray  $ignored_functions= 'array()'
static

array of function names to ignore from the profile (pass into xhprof_enable)
Default valuearray()Details
Type
array
Propertyprotected\SugarXHprof  $instance= 'null'
static

instance of profiler
Default valuenullDetails
Type
\SugarXHprof
Propertyprotectedstring  $log_to= ''''
static

path to directory for logs, if log_to is empty then xhprof.output_dir be used
Default value''Details
Type
string
Propertyprotectedstring  $manager= '__CLASS__'
static

class of manager for customization, has to extend from SugarXHprof class
Default value__CLASS__Details
Type
string
Propertyprotectedbool  $registered= 'false'

Because of unregister_shutdown_function is not present in php we have to skip calls of 'end' method if that property equals to false

is shutdown function registered or not
Default valuefalseDetails
Type
bool
Propertyprotectedint  $sample_rate= '10'
static

where value is a number and 1/value requests are profiled. So to sample all requests set it to 1
Default value10Details
Type
int

Methods

methodpublicdetectAction( ) : string
static

Method tries to detect entryPoint, service, module & action and returns it as string

Returns
Type Description
string action
methodpublicend( ) : void

Tries to collect data from XHprof after call of 'start' method

methodpublicgetInstance( ) : \SugarXHprof
static

Tries to load custom profiler. If it doesn't exist then use itself

Returns
Type Description
\SugarXHprof
methodprotectedloadConfig( ) : void
static

Populates configuration from $sugar_config to self properties

methodpublicstart( ) : void

Tries to enabled xhprof if all settings were passed

Documentation was generated by DocBlox 0.18.1.