Index: trunk/core/kernel/utility/debugger/debugger.js =================================================================== diff -u -N -r4834 -r4858 --- trunk/core/kernel/utility/debugger/debugger.js (.../debugger.js) (revision 4834) +++ trunk/core/kernel/utility/debugger/debugger.js (.../debugger.js) (revision 4858) @@ -1,19 +1,19 @@ -function Req() {} +function DebugReq() {} -Req.timeout = 5000; //5 seconds +DebugReq.timeout = 5000; //5 seconds -Req.makeRequest = function(p_url, p_busyReq, p_progId, p_successCallBack, p_errorCallBack, p_pass) { +DebugReq.makeRequest = function(p_url, p_busyReq, p_progId, p_successCallBack, p_errorCallBack, p_pass) { //p_url: the web service url //p_busyReq: is a request for this object currently in progress? //p_progId: element id where progress HTML should be shown //p_successCallBack: callback function for successful response //p_errorCallBack: callback function for erroneous response //p_pass: string of params to pass to callback functions if (p_busyReq) return; - var req = Req.getRequest(); + var req = DebugReq.getRequest(); if (req != null) { p_busyReq = true; - Req.showProgress(p_progId); + DebugReq.showProgress(p_progId); req.onreadystatechange = function() { if (req.readyState == 4) { p_busyReq = false; @@ -28,27 +28,27 @@ req.open('GET', p_url, true); req.setRequestHeader('If-Modified-Since', 'Sat, 1 Jan 2000 00:00:00 GMT'); req.send(null); - var toId = window.setTimeout( function() {if (p_busyReq) req.abort();}, Req.timeout ); + var toId = window.setTimeout( function() {if (p_busyReq) req.abort();}, DebugReq.timeout ); } } -Req.getRequest = function() { +DebugReq.getRequest = function() { var xmlHttp; try { xmlHttp = new ActiveXObject('MSXML2.XMLHTTP'); return xmlHttp; } catch (e) {} try { xmlHttp = new ActiveXObject('Microsoft.XMLHTTP'); return xmlHttp; } catch (e) {} try { xmlHttp = new XMLHttpRequest(); return xmlHttp; } catch(e) {} return null; } -Req.showProgress = function(p_id) { - $Debugger.AppendRow(Req.getProgressHtml()); +DebugReq.showProgress = function(p_id) { + $Debugger.AppendRow(DebugReq.getProgressHtml()); } -Req.getProgressHtml = function() { +DebugReq.getProgressHtml = function() { return 'Loading ...'; } -Req.getErrorHtml = function(p_req) { +DebugReq.getErrorHtml = function(p_req) { //TODO: implement accepted way to handle request error return "

" + "(" + p_req.status + ") " + p_req.statusText + "

" } @@ -124,7 +124,7 @@ } Debugger.prototype.Query = function() { - Req.makeRequest(this.DebugURL, this.busyReq, '', this.successCallback, this.errorCallback, ''); + DebugReq.makeRequest(this.DebugURL, this.busyReq, '', this.successCallback, this.errorCallback, ''); } Debugger.prototype.successCallback = function(p_req, p_pass) { @@ -152,7 +152,7 @@ } Debugger.prototype.errorCallback = function(p_req, p_pass) { - alert('AJAX ERROR: '+Req.getErrorHtml(p_req)); + alert('AJAX ERROR: '+DebugReq.getErrorHtml(p_req)); $Debugger.Refresh(); } Index: trunk/core/kernel/utility/debugger.php =================================================================== diff -u -N -r4835 -r4858 --- trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 4835) +++ trunk/core/kernel/utility/debugger.php (.../debugger.php) (revision 4858) @@ -781,7 +781,7 @@ $this->memoryUsage['print_report'] = $this->memoryUsage['debugger_finish'] - $this->memoryUsage['debugger_start']; $this->memoryUsage['total'] = $this->memoryUsage['print_report'] + $this->memoryUsage['error_handling']; $this->memoryUsage['application'] = memory_get_usage() - $this->memoryUsage['total']; - + $this->memoryUsage['debugfile_size'] = filesize($debug_file); if ($returnResult) { $ret = ob_get_contents(); @@ -815,21 +815,36 @@ function getMemoryUsageReport() { $info = Array( - 'printReport' => 'print_report', - 'saveError' => 'error_handling', - 'Total' => 'total', - 'Application' => 'application' + 'Application' => 'MEM:application', + 'Script runtime'=> 'PROFILE:script_runtime', + '-' => 'SEP:-', + 'printReport' => 'MEM:print_report', + 'saveError' => 'MEM:error_handling', + 'Debug Total' => 'MEM:total', + 'Debug FileSize'=> 'MEM:debugfile_size' ); - $ret = ''; + $ret = ''; foreach ($info as $title => $value_key) { - $ret .= ''; + list ($record_type, $record_data) = explode(':', $value_key, 2); + switch ($record_type) { + case 'MEM': + $ret .= ''; + break; + + case 'PROFILE': + $Data =& $this->ProfilerData[$record_data]; + $profile_time = ($Data['ends'] - $Data['begins']); // in seconds + $ret .= ''; + break; + + case 'SEP': + $ret .= ''; + break; + } } - $Data =& $this->ProfilerData['script_runtime']; - $runtime = ($Data['ends'] - $Data['begins']); // in seconds - $ret .= '
'.$title.':'.$this->formatSize($this->memoryUsage[$value_key]).'
'.$title.':'.$this->formatSize($this->memoryUsage[$record_data]).' ('.$this->memoryUsage[$record_data].')
'.$title.':'.sprintf('%.5f', $profile_time).'s

Script runtime:'.sprintf('%.5f', $runtime).'s
'; - return $ret; + return '
'.$ret.'
'; } Index: trunk/index.php =================================================================== diff -u -N -r4243 -r4858 --- trunk/index.php (.../index.php) (revision 4243) +++ trunk/index.php (.../index.php) (revision 4858) @@ -16,10 +16,19 @@ $end = getmicrotime(); -if ($application->isDebugMode() && !dbg_ConstOn('DBG_SKIP_REPORTING')) { - echo '

Memory used: '.round(memory_get_usage()/1024/1024, 1).' Mb
'; - echo 'Time used: '.round(($end - $start), 5).' Sec
'; -} +/*if ($application->isDebugMode() && !dbg_ConstOn('DBG_SKIP_REPORTING')) { + echo '

+ + + + + + + + + +
Memory used:'.round(memory_get_usage()/1024/1024, 1).' MB ('.memory_get_usage().')
Time used:'.round(($end - $start), 5).' sec
'; +}*/ //print_pre(get_included_files()); Index: trunk/admin/index.php =================================================================== diff -u -N -r4758 -r4858 --- trunk/admin/index.php (.../index.php) (revision 4758) +++ trunk/admin/index.php (.../index.php) (revision 4858) @@ -17,10 +17,9 @@ $end = getmicrotime(); -if ($application->isDebugMode() && !dbg_ConstOn('DBG_SKIP_REPORTING')) { +/*if ($application->isDebugMode() && !dbg_ConstOn('DBG_SKIP_REPORTING')) { echo '

- - +
@@ -30,7 +29,7 @@
Memory used: '.round(memory_get_usage()/1024/1024, 1).' MB ('.memory_get_usage().')'.round(($end - $start), 5).' sec
'; -} +}*/ function getmicrotime() { Index: trunk/core/kernel/utility/debugger/debugger.css =================================================================== diff -u -N -r4821 -r4858 --- trunk/core/kernel/utility/debugger/debugger.css (.../debugger.css) (revision 4821) +++ trunk/core/kernel/utility/debugger/debugger.css (.../debugger.css) (revision 4858) @@ -7,17 +7,22 @@ display: inline; } -.dbg_flat_table { +.dbg_flat_table, .dbg_stats_table { border-collapse: collapse; width: auto; margin: 0px; } -.dbg_flat_table TD { +.dbg_flat_table TD, .dbg_stats_table TD { border: 1px solid #CCCCCC; padding: 4px; } +.dbg_stats_table TD { + font-family: Arial, Verdana; + font-size: 9pt; +} + .debug_layer_table { border-collapse: collapse; }