mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-06 10:11:38 +09:00
Provide methods to tell total elapsed time
This commit is contained in:
parent
421199b196
commit
902b931b89
2 changed files with 23 additions and 2 deletions
|
|
@ -947,6 +947,26 @@ class DB
|
|||
Debug::addQuery($log);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total time spent during queries.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getQueryElapsedTime()
|
||||
{
|
||||
return $this->_query_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get total time spent in this class.
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getTotalElapsedTime()
|
||||
{
|
||||
return $this->_total_time;
|
||||
}
|
||||
|
||||
/**
|
||||
* ========================== DEPRECATED METHODS ==========================
|
||||
* ==================== KEPT FOR COMPATIBILITY WITH XE ====================
|
||||
|
|
|
|||
|
|
@ -746,6 +746,7 @@ class Debug
|
|||
public static function getDebugData()
|
||||
{
|
||||
// Collect debug information.
|
||||
$db = DB::getInstance();
|
||||
$data = (object)array(
|
||||
'timestamp' => DateTime::formatTimestamp('Y-m-d H:i:s', \RX_TIME),
|
||||
'url' => getCurrentPageUrl(),
|
||||
|
|
@ -761,8 +762,8 @@ class Debug
|
|||
'total' => sprintf('%0.4f sec', microtime(true) - \RX_MICROTIME),
|
||||
'template' => sprintf('%0.4f sec (count: %d)', $GLOBALS['__template_elapsed__'], $GLOBALS['__TemplateHandlerCalled__']),
|
||||
'xmlparse' => sprintf('%0.4f sec', $GLOBALS['__xmlparse_elapsed__']),
|
||||
'db_query' => sprintf('%0.4f sec (count: %d)', $GLOBALS['__db_elapsed_time__'], count(self::$_queries)),
|
||||
'db_class' => sprintf('%0.4f sec', $GLOBALS['__dbclass_elapsed_time__'] - $GLOBALS['__db_elapsed_time__']),
|
||||
'db_query' => sprintf('%0.4f sec (count: %d)', $db->getQueryElapsedTime(), count(self::$_queries)),
|
||||
'db_class' => sprintf('%0.4f sec', $db->getTotalElapsedTime() - $db->getQueryElapsedTime()),
|
||||
'layout' => sprintf('%0.4f sec', $GLOBALS['__layout_compile_elapsed__']),
|
||||
'widget' => sprintf('%0.4f sec', $GLOBALS['__widget_excute_elapsed__']),
|
||||
'remote' => sprintf('%0.4f sec', $GLOBALS['__remote_request_elapsed__']),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue