Definition at line 10 of file Profiler.php.
◆ _getTimerName()
_getTimerName |
( |
|
$operation | ) |
|
|
protected |
Form and return timer name
- Parameters
-
- Returns
- string
Definition at line 33 of file Profiler.php.
39 if (!empty($this->_type)) {
44 $timerName .=
'_' . $operation;
47 if (!empty($this->_host)) {
51 return \Magento\Framework\Model\ResourceModel\Db\Profiler::TIMER_PREFIX .
':' . $timerName;
const DEFAULT_CONNECTION_TYPE
◆ _parseQueryType()
_parseQueryType |
( |
|
$queryText | ) |
|
|
protected |
Parse query type and return
- Parameters
-
- Returns
- string
Definition at line 60 of file Profiler.php.
62 $queryTypeParsed = strtolower(substr(ltrim($queryText), 0, 6));
64 if (!in_array($queryTypeParsed, $this->_queryTypes)) {
65 $queryTypeParsed =
'query';
68 return $queryTypeParsed;
◆ queryStart()
queryStart |
( |
|
$queryText, |
|
|
|
$queryType = null |
|
) |
| |
Starts a query. Creates a new query profile object (\Zend_Db_Profiler_Query)
- Parameters
-
string | $queryText | SQL statement |
integer | $queryType | OPTIONAL Type of query, one of the \Zend_Db_Profiler::* constants |
- Returns
- integer|null
Definition at line 78 of file Profiler.php.
80 $result = parent::queryStart($queryText, $queryType);
92 $typePrefix = $this->_type .
':';
96 $tags[
'operation'] = $typePrefix . $queryTypeParsed;
103 \Magento\Framework\Profiler::start($timerName, $tags);
_parseQueryType($queryText)
_getTimerName($operation)
◆ $_queryTypes
$_queryTypes = ['select', 'insert', 'update', 'delete'] |
|
protected |
◆ DEFAULT_CONNECTION_TYPE
const DEFAULT_CONNECTION_TYPE = 'database' |
Default connection type for timer name creation
Definition at line 20 of file Profiler.php.
◆ TIMER_PREFIX
const TIMER_PREFIX = 'DB_QUERY' |
Default connection type for timer name creation
Definition at line 15 of file Profiler.php.
The documentation for this class was generated from the following file:
- vendor/magento/framework/Model/ResourceModel/Db/Profiler.php