Class JProfiler

Description

Utility class to assist in the process of benchmarking the execution of sections of code to understand where time is being spent.

  • since: 11.1

Located in /libraries/joomla/error/profiler.php (line 20)

JObject
   |
   --JProfiler
Variable Summary
static array $instances
array $_buffer
boolean $_iswin
string $_prefix
integer $_start
Method Summary
static JProfiler getInstance ([string $prefix = ''])
static float getmicrotime ()
JProfiler __construct ([string $prefix = ''])
array getBuffer ()
integer getMemory ()
string mark (string $label)
Variables
static array $instances = array() (line 62)
  • var: JProfiler instances container.
  • since: 11.3
  • access: protected
array $_buffer = null (line 38)
  • var: The buffer of profiling messages.
  • since: 11.1
  • access: protected
boolean $_iswin = false (line 56)
  • var: Boolean if the OS is Windows.
  • since: 11.1
  • access: protected
string $_prefix = '' (line 32)
  • var: The prefix to use in the output
  • since: 11.1
  • access: protected
float $_previous_mem = 0.0 (line 50)
  • since: 11.1
  • access: protected
float $_previous_time = 0.0 (line 44)
  • since: 11.1
  • access: protected
integer $_start = 0 (line 26)
  • var: The start time.
  • since: 11.1
  • access: protected

Inherited Variables

Inherited from JObject

JObject::$_errors
Methods
static method getInstance (line 89)

Returns the global Profiler object, only creating it if it doesn't already exist.

  • return: The Profiler object.
  • since: 11.1
  • access: public
static JProfiler getInstance ([string $prefix = ''])
  • string $prefix: Prefix used to distinguish profiler objects.
static method getmicrotime (line 146)

Get the current time.

  • return: The current time
  • since: 11.1
  • access: public
static float getmicrotime ()
Constructor __construct (line 71)

Constructor

  • since: 11.1
  • access: public
JProfiler __construct ([string $prefix = ''])
  • string $prefix: Prefix for mark messages

Redefinition of:
JObject::__construct()
Class constructor, overridden in descendant classes.
getBuffer (line 199)

Get all profiler marks.

Returns an array of all marks created since the Profiler object was instantiated. Marks are strings as per JProfiler::mark().

  • return: Array of profiler marks
  • access: public
array getBuffer ()
getMemory (line 161)

Get information about current memory usage.

integer getMemory ()
mark (line 111)

Output a time mark

The mark is returned as text enclosed in <div> tags with a CSS class of 'profiler'.

  • return: Mark enclosed in <div> tags
  • since: 11.1
  • access: public
string mark (string $label)
  • string $label: A label for the time mark

Inherited Methods

Inherited From JObject

JObject::__construct()
JObject::def()
JObject::get()
JObject::getError()
JObject::getErrors()
JObject::getProperties()
JObject::set()
JObject::setError()
JObject::setProperties()
JObject::toString()
JObject::__toString()

Documentation generated on Mon, 25 Jun 2012 13:58:58 -0500 by phpDocumentor 1.4.4