Class Zend_Db_Profiler

Description
  • license: Zend
  • copyright: Copyright (c) 2005-2006 Zend Technologies Inc. (http://www.zend.com)

Located in /library/Zend/Db/Profiler.php (line 37)


	
			
Class Constant Summary
 CONNECT = 1
 DELETE = 16
 INSERT = 4
 QUERY = 2
 SELECT = 32
 UPDATE = 8
Variable Summary
Method Summary
 unknown clear ()
 bool getEnabled ()
 mixed getQueryProfiles ([string $queryType = null], [bool $showUnfinished = false])
 int getTotalElapsedSecs ([int $queryType = null])
 int getTotalNumQueries ([int $queryType = null])
 Zend_Db_Profiler __construct ([bool $enabled = false])
 boolean queryEnd (integer $queryId)
 mixed queryStart (string $queryText, [int $queryType = null])
 bool setEnabled (bool $enable)
 bool setFilterElapsedSecs ([int $minimumSeconds = null])
 void setFilterQueryType ([null|integer $queryTypes = null])
Variables
bool $_enabled = false (line 91)

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

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

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 112)

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
Zend_Db_Profiler_Query $_queryProfiles = array() (line 83)

Array of Zend_Db_Profiler_Query objects.

  • access: protected
Methods
clear (line 195)

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

  • access: public
unknown clear ()
getEnabled (line 182)

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

  • access: public
bool getEnabled ()
getLastQueryProfile (line 405)

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, it's end time will be Null.

  • access: public
Zend_Db_Profiler_Query getLastQueryProfile ()
getQueryProfile (line 306)

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.

  • access: public
  • throws: Zend_Db_Profiler_Exception
Zend_Db_Profiler_Query getQueryProfile (int $queryId)
  • int $queryId
getQueryProfiles (line 327)

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.

  • access: public
mixed getQueryProfiles ([string $queryType = null], [bool $showUnfinished = false])
  • string $queryType
  • bool $showUnfinished
getTotalElapsedSecs (line 359)

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 of the Zend_Db_Profiler::* constants, the elapsed time will be calculated only for queries of that type.

  • access: public
int getTotalElapsedSecs ([int $queryType = null])
  • int $queryType
getTotalNumQueries (line 381)

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
int getTotalNumQueries ([int $queryType = null])
  • int $queryType
Constructor __construct (line 121)

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

  • access: public
Zend_Db_Profiler __construct ([bool $enabled = false])
  • bool $enabled
queryEnd (line 255)

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

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

  • access: public
  • throws: Zend_Db_Profiler_Exception
boolean queryEnd (integer $queryId)
  • integer $queryId
queryStart (line 213)

Start 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 runs.

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

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

  • access: public
bool setEnabled (bool $enable)
  • bool $enable
setFilterElapsedSecs (line 150)

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.

  • access: public
bool setFilterElapsedSecs ([int $minimumSeconds = null])
  • int $minimumSeconds
setFilterQueryType (line 169)

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.

  • access: public
void setFilterQueryType ([null|integer $queryTypes = null])
  • null|integer $queryTypes
Class Constants
CONNECT = 1 (line 43)

A connection operation or selecting a database.

DELETE = 16 (line 65)

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

INSERT = 4 (line 53)

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

QUERY = 2 (line 48)

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

SELECT = 32 (line 70)

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

TRANSACTION = 64 (line 75)

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

UPDATE = 8 (line 59)

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

Documentation generated on Wed, 08 Mar 2006 04:54:14 -0800 by phpDocumentor 1.3.0RC4