Class Zend_Db_Profiler

Description
  • copyright: Copyright (c) 2005-2010 Zend Technologies USA Inc. (http://www.zend.com)
  • license: New BSD License

Located in /Db/Profiler.php (line 31)


	
			
Direct descendents
Class Description
 class Zend_Db_Profiler_Firebug Writes DB events as log messages to the Firebug Console via FirePHP.
Class Constant Summary
 CONNECT = 1
 DELETE = 16
 IGNORED = 'ignored'
 INSERT = 4
 QUERY = 2
 SELECT = 32
 STORED = 'stored'
 UPDATE = 8
Variable Summary
Method Summary
 boolean getEnabled ()
 integer|null getFilterElapsedSecs ()
 integer|null getFilterQueryType ()
 array|false getQueryProfiles ([integer $queryType = null], [boolean $showUnfinished = false])
 float getTotalElapsedSecs ([integer $queryType = null])
 integer getTotalNumQueries ([integer $queryType = null])
 void __construct ([boolean $enabled = false])
 integer queryClone (Zend_Db_Profiler_Query $query, integer $queryId)
 void queryEnd (integer $queryId)
 integer|null queryStart (string $queryText, [integer $queryType = null])
 Zend_Db_Profiler setEnabled (boolean $enable)
 Zend_Db_Profiler setFilterElapsedSecs ([integer $minimumSeconds = null])
 Zend_Db_Profiler setFilterQueryType ([integer $queryTypes = null])
Variables
boolean $_enabled = false (line 94)

Stores enabled state of the profiler. If set to False, calls to queryStart() will simply be ignored.

  • access: protected
integer $_filterElapsedSecs = null (line 104)

Stores the number of seconds to filter. NULL if filtering by time is disabled. If an integer is stored here, profiles whose elapsed time is less than this value in seconds will be unset from the self::$_queryProfiles array.

  • access: protected
integer $_filterTypes = null (line 115)

Logical OR of any of the filter constants. NULL if filtering by query

type is disable. If an integer is stored here, it is the logical OR of any of the query type constants. When the query ends, if it is not one of the types specified, it will be unset from the self::$_queryProfiles array.

  • access: protected
array $_queryProfiles = array() (line 86)

Array of Zend_Db_Profiler_Query objects.

  • access: protected
Methods
clear (line 220)

Clears the history of any past query profiles. This is relentless and will even clear queries that were started and may not have been marked as ended.

  • return: Provides a fluent interface
  • access: public
Zend_Db_Profiler clear ()
getEnabled (line 149)

Get the current state of enable. If True is returned, the profiler is enabled.

  • access: public
boolean getEnabled ()
getFilterElapsedSecs (line 180)

Returns the minimum number of seconds for saving query profiles, or null if query profiles are saved regardless of elapsed time.

  • access: public
integer|null getFilterElapsedSecs ()
getFilterQueryType (line 208)

Returns the types of query profiles saved, or null if queries are saved regardless of their types.

integer|null getFilterQueryType ()
getLastQueryProfile (line 459)

Get the Zend_Db_Profiler_Query object for the last query that was run, regardless if it has ended or not. If the query has not ended, its end time will be null. If no queries have been profiled, false is returned.

  • access: public
Zend_Db_Profiler_Query|false getLastQueryProfile ()
getQueryProfile (line 356)

Get a profile for a query. Pass it the same handle that was returned by queryStart() and it will return a Zend_Db_Profiler_Query object.

  • throws: Zend_Db_Profiler_Exception
  • access: public
Zend_Db_Profiler_Query getQueryProfile (integer $queryId)
  • integer $queryId
getQueryProfiles (line 381)

Get an array of query profiles (Zend_Db_Profiler_Query objects). If $queryType

is set to one of the Zend_Db_Profiler::* constants then only queries of that type will be returned. Normally, queries that have not yet ended will not be returned unless $showUnfinished is set to True. If no queries were found, False is returned. The returned array is indexed by the query profile handles.

  • access: public
array|false getQueryProfiles ([integer $queryType = null], [boolean $showUnfinished = false])
  • integer $queryType
  • boolean $showUnfinished
getTotalElapsedSecs (line 412)

Get the total elapsed time (in seconds) of all of the profiled queries.

Only queries that have ended will be counted. If $queryType is set to one or more of the Zend_Db_Profiler::* constants, the elapsed time will be calculated only for queries of the given type(s).

  • access: public
float getTotalElapsedSecs ([integer $queryType = null])
  • integer $queryType: OPTIONAL
getTotalNumQueries (line 436)

Get the total number of queries that have been profiled. Only queries that have ended will be counted. If $queryType is set to one of the Zend_Db_Profiler::* constants, only queries of that type will be counted.

  • access: public
integer getTotalNumQueries ([integer $queryType = null])
  • integer $queryType: OPTIONAL
Constructor __construct (line 124)

Class constructor. The profiler is disabled by default unless it is specifically enabled by passing in $enabled here or calling setEnabled().

  • access: public
void __construct ([boolean $enabled = false])
  • boolean $enabled

Redefined in descendants as:
queryClone (line 231)
  • return: or null
  • access: public
integer queryClone (Zend_Db_Profiler_Query $query, integer $queryId)
queryEnd (line 297)

Ends a query. Pass it the handle that was returned by queryStart().

This will mark the query as ended and save the time.

  • throws: Zend_Db_Profiler_Exception
  • access: public
void queryEnd (integer $queryId)
  • integer $queryId

Redefined in descendants as:
queryStart (line 251)

Starts a query. Creates a new query profile object (Zend_Db_Profiler_Query)

and returns the "query profiler handle". Run the query, then call queryEnd() and pass it this handle to make the query as ended and record the time. If the profiler is not enabled, this takes no action and immediately returns null.

  • access: public
integer|null queryStart (string $queryText, [integer $queryType = null])
  • string $queryText: SQL statement
  • integer $queryType: OPTIONAL Type of query, one of the Zend_Db_Profiler::* constants
setEnabled (line 136)

Enable or disable the profiler. If $enable is false, the profiler is disabled and will not log any queries sent to it.

  • return: Provides a fluent interface
  • access: public
Zend_Db_Profiler setEnabled (boolean $enable)
  • boolean $enable

Redefined in descendants as:
setFilterElapsedSecs (line 163)

Sets a minimum number of seconds for saving query profiles. If this is set, only those queries whose elapsed time is equal or greater than $minimumSeconds will be saved. To save all queries regardless of elapsed time, set $minimumSeconds to null.

  • return: Provides a fluent interface
  • access: public
Zend_Db_Profiler setFilterElapsedSecs ([integer $minimumSeconds = null])
  • integer $minimumSeconds: OPTIONAL
setFilterQueryType (line 194)

Sets the types of query profiles to save. Set $queryType to one of the Zend_Db_Profiler::* constants to only save profiles for that type of query. To save more than one type, logical OR them together. To save all queries regardless of type, set $queryType to null.

  • return: Provides a fluent interface
  • access: public
Zend_Db_Profiler setFilterQueryType ([integer $queryTypes = null])
  • integer $queryTypes: OPTIONAL
Class Constants
CONNECT = 1 (line 37)

A connection operation or selecting a database.

DELETE = 16 (line 59)

An operation related to deleting data in the database, such as SQL's DELETE.

IGNORED = 'ignored' (line 79)

Inform that a query is ignored (in case of filtering)

INSERT = 4 (line 47)

Adding new data to the database, such as SQL's INSERT.

QUERY = 2 (line 42)

Any general database query that does not fit into the other constants.

SELECT = 32 (line 64)

Retrieving information from the database, such as SQL's SELECT.

STORED = 'stored' (line 74)

Inform that a query is stored (in case of filtering)

TRANSACTION = 64 (line 69)

Transactional operation, such as start transaction, commit, or rollback.

UPDATE = 8 (line 53)

Updating existing information in the database, such as SQL's UPDATE.

Documentation generated on Mon, 21 Jun 2010 15:39:58 -0400 by phpDocumentor 1.4.3