当前位置: 首页>>代码示例>>PHP>>正文


PHP Zend_Db_Profiler::queryEnd方法代码示例

本文整理汇总了PHP中Zend_Db_Profiler::queryEnd方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_Db_Profiler::queryEnd方法的具体用法?PHP Zend_Db_Profiler::queryEnd怎么用?PHP Zend_Db_Profiler::queryEnd使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Zend_Db_Profiler的用法示例。


在下文中一共展示了Zend_Db_Profiler::queryEnd方法的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: queryEnd

 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     $profile = $this->getQueryProfile($queryId);
     $this->_totalElapsedTime += $profile->getElapsedSecs();
     $this->_logger->info(implode(' ', array((string) round($profile->getElapsedSecs(), 5), $profile->getQuery(), ($params = $profile->getQueryParams()) ? implode(' ', $params) : null)));
 }
开发者ID:nurikk,项目名称:EvilRocketFramework,代码行数:7,代码来源:Profiler.php

示例2: rollBack

 /**
  * Roll back a transaction and return to autocommit mode.
  *
  * @return Zend_Db_Adapter_Abstract
  */
 public function rollBack()
 {
     $this->_connect();
     $q = $this->_profiler->queryStart('rollback', Zend_Db_Profiler::TRANSACTION);
     $this->_rollBack();
     $this->_profiler->queryEnd($q);
     return $this;
 }
开发者ID:Gradven,项目名称:what3.1.7,代码行数:13,代码来源:Abstract.php

示例3: queryEnd

 /**
  * Intercept the query end and log the profiling data.
  *
  * @param  integer $queryId
  * @throws Zend_Db_Profiler_Exception
  * @return void
  */
 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     if (!$this->getEnabled() || $state == self::IGNORED) {
         return;
     }
     $profile = $this->getQueryProfile($queryId);
     echo (string) round($profile->getElapsedSecs(), 5) . PHP_EOL . $profile->getQuery() . PHP_EOL . (($params = $profile->getQueryParams()) ? $params : null) . PHP_EOL;
 }
开发者ID:null-1,项目名称:fangtaitong,代码行数:16,代码来源:Console.php

示例4: queryEnd

 /**
  * Intercept the query end and log the profiling data.
  *
  * @param  integer $queryId
  * @throws \Zend_Db_Profiler_Exception
  * @return void
  */
 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     if (!$this->getEnabled() || $state == self::IGNORED) {
         return;
     }
     $profile = $this->getQueryProfile($queryId);
     $this->_totalElapsedTime += $profile->getElapsedSecs();
     $this->_totalQueries++;
     $logEntry = $profile->getQuery() . " | " . implode(",", $profile->getQueryParams());
     \Logger::debug($logEntry, ["connection" => $this->getConnectionId(), "queryNum" => $this->_totalQueries, "time" => (string) round($profile->getElapsedSecs(), 5)]);
     $this->queries[] = array("time" => $profile->getElapsedSecs(), "query" => $profile->getQuery() . " | " . implode(",", $profile->getQueryParams()));
 }
开发者ID:emanuel-london,项目名称:pimcore,代码行数:20,代码来源:Profiler.php

示例5: queryEnd

 /**
  * Intercept the query end and log the profiling data.
  *
  * @param  integer $queryId
  * @throws Zend_Db_Profiler_Exception
  * @return void
  */
 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     if (!$this->getEnabled() || $state == self::IGNORED) {
         return;
     }
     // get profile of the current query
     $profile = $this->getQueryProfile($queryId);
     // update totalElapsedTime counter
     $this->_totalElapsedTime += $profile->getElapsedSecs();
     // create the message to be logged
     $message = "\nElapsed Secs: " . round($profile->getElapsedSecs(), 5) . "\n";
     $message .= "Query: " . $profile->getQuery() . "\n";
     // log the message as INFO message
     $this->_log->info($message);
 }
开发者ID:MichaelGogeshvili,项目名称:sitewatch,代码行数:23,代码来源:Log.php

示例6: queryEnd

 /**
  * Obsluga zakonczenia kwerendy.
  *
  * @param  integer $queryId
  * @throws Zend_Db_Profiler_Exception
  * @return void
  */
 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     if (!$this->getEnabled() || $state == self::IGNORED) {
         //do nothing ... ignore log
     } else {
         // get profile of the current query
         $profile = $this->getQueryProfile($queryId);
         // update totalElapsedTime counter
         $this->_totalElapsedTime += $profile->getElapsedSecs();
         // create the message to be logged
         $message = sprintf("TIME(%s): %f\n", $queryId, $profile->getElapsedSecs());
         // log the message as INFO message
         $this->_log->info($message);
     }
     return $state;
 }
开发者ID:Webowiec,项目名称:zendnote,代码行数:24,代码来源:SqlLogger.php

示例7: queryEnd

 public function queryEnd($queryId)
 {
     $result = parent::queryEnd($queryId);
     if ($result == self::STORED) {
         $profile = $this->getLastQueryProfile();
         /* @var $profile Zend_Db_Profiler_Query */
         if (!isset($this->_types[$profile->getQueryType()])) {
             $this->_types[$profile->getQueryType()] = 0;
         }
         $this->_types[$profile->getQueryType()]++;
         $query = $profile->getQuery();
         $data = array('query' => $query, 'elapsed' => $profile->getElapsedSecs(), 'params' => $profile->getQueryParams());
         $data = json_encode($data);
         $queue = Mage::getStoreConfig(Eschrade_PubSubLogger_Model_Observer::SYSTEM_CONFIG_ENDPOINT) . '_pslogger_sql';
         $this->_observer->publish($queue, $data);
     }
 }
开发者ID:brianhillz0r,项目名称:Magento-Realtime-Logger,代码行数:17,代码来源:Profiler.php

示例8: queryEnd

 /**
  * Intercept the query end and log the profiling data.
  *
  * @param  integer $queryId
  * @throws Zend_Db_Profiler_Exception
  * @return void
  */
 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     if (!$this->getEnabled() || $state == self::IGNORED) {
         return;
     }
     $profile = $this->getQueryProfile($queryId);
     $this->_totalElapsedTime += $profile->getElapsedSecs();
     $logEntry = "DB Query: " . (string) round($profile->getElapsedSecs(), 5) . " | " . $profile->getQuery() . " | " . implode(",", $profile->getQueryParams());
     Logger::debug($logEntry);
     if (!empty($_REQUEST["pimcore_dbprofile"])) {
         if (!is_resource($this->logFile)) {
             $logFile = dirname(PIMCORE_LOG_DEBUG) . "/dbprofile-" . $_REQUEST["pimcore_dbprofile"] . ".log";
             file_put_contents($logFile, "");
             $this->logFile = fopen($logFile, "a+");
         }
         fwrite($this->logFile, $logEntry . "\n");
     }
 }
开发者ID:ngocanh,项目名称:pimcore,代码行数:26,代码来源:Profiler.php

示例9: queryEnd

 /**
  * Intercept the query end and log the profiling data.
  *
  * @param  integer $queryId
  * @throws Zend_Db_Profiler_Exception
  * @return void
  */
 public function queryEnd($queryId)
 {
     $state = parent::queryEnd($queryId);
     if (!$this->getEnabled() || $state == self::IGNORED) {
         return;
     }
     $this->_message->setDestroy(false);
     $profile = $this->getQueryProfile($queryId);
     $this->_totalElapsedTime += $profile->getElapsedSecs();
     $this->_message->addRow(array((string) round($profile->getElapsedSecs(), 5), $profile->getQuery(), ($params = $profile->getQueryParams()) ? $params : null));
     $this->updateMessageLabel();
 }
开发者ID:GerDner,项目名称:luck-docker,代码行数:19,代码来源:Firebug.php


注:本文中的Zend_Db_Profiler::queryEnd方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。