コード例 #1
0
 public function testQueryEndLast()
 {
     $this->_profiler->queryStart('SELECT * FROM table');
     $endResult = $this->_profiler->queryEndLast();
     $this->assertAttributeEquals(null, '_lastQueryId', $this->_profiler);
     $this->assertEquals(Varien_Db_Profiler::STORED, $endResult);
     $endResult = $this->_profiler->queryEndLast();
     $this->assertEquals(Varien_Db_Profiler::IGNORED, $endResult);
 }
コード例 #2
0
 /**
  * Ends a query. Pass it the handle that was returned by queryStart().
  *
  * @param int $queryId
  * @return string|void
  */
 public function queryEnd($queryId)
 {
     $result = parent::queryEnd($queryId);
     if ($result != self::IGNORED) {
         /** @var Zend_Db_Profiler_Query $queryProfile */
         $queryProfile = $this->_queryProfiles[$queryId];
         $queryTypeParsed = $this->_parseQueryType($queryProfile->getQuery());
         $timerName = $this->_getTimerName($queryTypeParsed);
         Magento_Profiler::stop($timerName);
     }
     return $result;
 }