BlueSpice MediaWiki REL1_27
 All Classes Namespaces Files Functions Variables Groups Pages
Profiler Class Reference
Inheritance diagram for Profiler:

Public Member Functions

 __construct (array $params)
 
 setProfileID ($id)
 
 getProfileID ()
 
 setContext ($context)
 
 getContext ()
 
 profileIn ($functionname)
 
 profileOut ($functionname)
 
 scopedProfileIn ($section)
 
 scopedProfileOut (ScopedCallback &$section=null)
 
 getTransactionProfiler ()
 
 close ()
 
 logData ()
 
 logDataPageOutputOnly ()
 
 getContentType ()
 
 setTemplated ($t)
 
 getTemplated ()
 
 getFunctionStats ()
 
 getOutput ()
 

Static Public Member Functions

static instance ()
 
static replaceStubInstance (Profiler $profiler)
 

Protected Attributes

 $profileID = false
 
 $templated = false
 
 $params = []
 
 $context = null
 
 $trxProfiler
 

Detailed Description

Profiler base class that defines the interface and some trivial functionality

Constructor & Destructor Documentation

Profiler::__construct ( array  $params)
Parameters
array$params

Member Function Documentation

Profiler::close ( )
abstract

Close opened profiling sections

Profiler::getContentType ( )

Get the content type sent out to the client. Used for profilers that output instead of store data.

Returns
string
Since
1.25
Profiler::getContext ( )

Gets the context for this Profiler

Returns
IContextSource
Since
1.25
Profiler::getFunctionStats ( )
abstract

Get the aggregated inclusive profiling data for each method

The percent time for each time is based on the current "total" time used is based on all methods so far. This method can therefore be called several times in between several profiling calls without the delays in usage of the profiler skewing the results. A "-total" entry is always included in the results.

When a call chain involves a method invoked within itself, any entries for the cyclic invocation should be be demarked with "@". This makes filtering them out easier and follows the xhprof style.

Returns
array List of method entries arrays, each having:
  • name : method name
  • calls : the number of invoking calls
  • real : real time elapsed (ms)
  • real : percent real time
  • cpu : CPU time elapsed (ms)
  • cpu : percent CPU time
  • memory : memory used (bytes)
  • memory : percent memory used
  • min_real : min real time in a call (ms)
  • max_real : max real time in a call (ms)
Since
1.25
Profiler::getOutput ( )
abstract

Returns a profiling output to be stored in debug file

Returns
string
Profiler::getProfileID ( )
Returns
string
Profiler::getTemplated ( )

Was this call as templated or not

Returns
bool
Profiler::getTransactionProfiler ( )
Returns
TransactionProfiler
Since
1.25
static Profiler::instance ( )
staticfinal
Profiler::logData ( )

Log the data to some store or even the page output

Since
1.25
Profiler::logDataPageOutputOnly ( )

Output current data to the page output if configured to do so

Exceptions
MWException
Since
1.26
static Profiler::replaceStubInstance ( Profiler  $profiler)
staticfinal

Replace the current profiler with $profiler if no non-stub profiler is set

Parameters
Profiler$profiler
Exceptions
MWException
Since
1.25
Profiler::scopedProfileIn (   $section)
abstract

Mark the start of a custom profiling frame (e.g. DB queries). The frame ends when the result of this method falls out of scope.

Parameters
string$section
Returns
ScopedCallback|null
Since
1.25
Profiler::scopedProfileOut ( ScopedCallback $section = null)
Parameters
ScopedCallback$section
Profiler::setContext (   $context)

Sets the context for this Profiler

Parameters
IContextSource$context
Since
1.25
Profiler::setProfileID (   $id)
Parameters
string$id
Profiler::setTemplated (   $t)

Mark this call as templated or not

Parameters
bool$t

The documentation for this class was generated from the following file: