本文整理汇总了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)));
}
示例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;
}
示例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;
}
示例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()));
}
示例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);
}
示例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;
}
示例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);
}
}
示例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");
}
}
示例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();
}