Magento 2 Documentation  2.3
Documentation for Magento 2 CMS v2.3 (December 2018)
Public Member Functions | Protected Attributes
Profiler Class Reference
Inheritance diagram for Profiler:
Zend_Db_Profiler Profiler

Public Member Functions

 setHost ($host)
 
 setType ($type)
 
 queryStart ($queryText, $queryType=null)
 
 queryEnd ($queryId)
 
 queryEndLast ()
 
- Public Member Functions inherited from Zend_Db_Profiler
 __construct ($enabled=false)
 
 setEnabled ($enable)
 
 getEnabled ()
 
 setFilterElapsedSecs ($minimumSeconds=null)
 
 getFilterElapsedSecs ()
 
 setFilterQueryType ($queryTypes=null)
 
 getFilterQueryType ()
 
 clear ()
 
 queryClone (Zend_Db_Profiler_Query $query)
 
 queryStart ($queryText, $queryType=null)
 
 queryEnd ($queryId)
 
 getQueryProfile ($queryId)
 
 getQueryProfiles ($queryType=null, $showUnfinished=false)
 
 getTotalElapsedSecs ($queryType=null)
 
 getTotalNumQueries ($queryType=null)
 
 getLastQueryProfile ()
 

Protected Attributes

 $_host = ''
 
 $_type = ''
 
- Protected Attributes inherited from Zend_Db_Profiler
 $_queryProfiles = array()
 
 $_enabled = false
 
 $_filterElapsedSecs = null
 
 $_filterTypes = null
 

Additional Inherited Members

- Data Fields inherited from Zend_Db_Profiler
const CONNECT = 1
 
const QUERY = 2
 
const INSERT = 4
 
const UPDATE = 8
 
const DELETE = 16
 
const SELECT = 32
 
const TRANSACTION = 64
 
const STORED = 'stored'
 
const IGNORED = 'ignored'
 

Detailed Description

Definition at line 10 of file Profiler.php.

Member Function Documentation

◆ queryEnd()

queryEnd (   $queryId)

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

Parameters
int$queryId
Returns
string|void

Definition at line 76 of file Profiler.php.

77  {
78  $this->_lastQueryId = null;
79  return parent::queryEnd($queryId);
80  }

◆ queryEndLast()

queryEndLast ( )

Ends the last query if exists. Used for finalize broken queries.

Returns
string|void

Definition at line 87 of file Profiler.php.

88  {
89  if ($this->_lastQueryId !== null) {
90  return $this->queryEnd($this->_lastQueryId);
91  }
92 
93  return self::IGNORED;
94  }

◆ queryStart()

queryStart (   $queryText,
  $queryType = null 
)

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

Parameters
string$queryTextSQL statement
integer | null$queryTypeOPTIONAL Type of query, one of the \Zend_Db_Profiler::* constants
Returns
integer|null

Definition at line 64 of file Profiler.php.

65  {
66  $this->_lastQueryId = parent::queryStart($queryText, $queryType);
67  return $this->_lastQueryId;
68  }

◆ setHost()

setHost (   $host)

Setter for host IP

Parameters
string$host
Returns
\Magento\Framework\DB\Profiler

Definition at line 39 of file Profiler.php.

40  {
41  $this->_host = $host;
42  return $this;
43  }

◆ setType()

setType (   $type)

Setter for database connection type

Parameters
string$type
Returns
\Magento\Framework\DB\Profiler

Definition at line 51 of file Profiler.php.

52  {
53  $this->_type = $type;
54  return $this;
55  }
$type
Definition: item.phtml:13

Field Documentation

◆ $_host

$_host = ''
protected

Definition at line 17 of file Profiler.php.

◆ $_type

$_type = ''
protected

Definition at line 24 of file Profiler.php.


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