Index: branches/RC/core/kernel/utility/debugger.php =================================================================== diff -u -N -r10577 -r10580 --- branches/RC/core/kernel/utility/debugger.php (.../debugger.php) (revision 10577) +++ branches/RC/core/kernel/utility/debugger.php (.../debugger.php) (revision 10580) @@ -80,6 +80,14 @@ * @var string */ var $baseURL = ''; + + + /** + * Holds last recorded timestamp (for appendTimestamp) + * + * @var int + */ + var $LastMoment; function Debugger() { @@ -101,6 +109,7 @@ $this->InitDebugger(); $this->profileStart('kernel4_startup', 'Startup and Initialization of kernel4', $start); $this->profileStart('script_runtime', 'Script runtime', $start); + $this->LastMoment = $start; error_reporting(E_ALL); ini_set('display_errors', $this->constOn('DBG_ZEND_PRESENT') ? 0 : 1); // show errors on screen in case if not in Zend Studio debugging @@ -260,6 +269,7 @@ // string used to separate debugger records while in file (used in debugger dump filename too) $this->rowSeparator = '@'.(is_object($application->Factory) ? $application->GetSID() : 0).'@'; +// $this->rowSeparator = '@'.rand(0,100000).'@'; // include debugger files from this url $reg_exp = '/^'.preg_quote(FULL_PATH, '/').'/'; @@ -887,6 +897,16 @@ list($usec, $sec) = explode(' ', microtime()); return ((float)$usec + (float)$sec); } + + function appendTimestamp($message) + { + global $start; + $time = $this->getMoment(); + $from_last = $time - $this->LastMoment; + $from_start = $time - $start; + $this->appendHTML(sprintf("%s %.5f from last %.5f from start", $message, $from_last, $from_start)); + $this->LastMoment = $time; + } function generateID() { @@ -1040,7 +1060,7 @@ } } - /*if ($this->constOn('DBG_PROFILE_INCLUDES')) { + if ($this->constOn('DBG_PROFILE_INCLUDES')) { $this->appendHTML('Included files statistics:'.( $this->constOn('DBG_SORT_INCLUDES_MEM') ? ' (sorted by memory usage)':'')); $totals = Array( 'mem' => 0, 'time' => 0); $totals_configs = Array( 'mem' => 0, 'time' => 0); @@ -1063,7 +1083,7 @@ $this->appendHTML('Sub-Total configs: '.' Mem: '.sprintf("%.4f Kb", $totals_configs['mem']/1024).' Time: '.sprintf("%.4f", $totals_configs['time'])); $this->appendHTML('Grand Total: '.' Mem: '.sprintf("%.4f Kb", ($totals['mem']+$totals_configs['mem'])/1024).' Time: '.sprintf("%.4f", $totals['time']+$totals_configs['time'])); } - }*/ + } $is_ajax = isset($_GET['ajax']) && $_GET['ajax'] == 'yes'; $skip_reporting = $this->constOn('DBG_SKIP_REPORTING') || $this->constOn('DBG_ZEND_PRESENT');