minor fixes: html output, speed, rtl lang
This commit is contained in:
@@ -9,6 +9,8 @@ $Source$
|
|||||||
* libraries/dbg/setup.php:
|
* libraries/dbg/setup.php:
|
||||||
- display error in error box
|
- display error in error box
|
||||||
- fixed 'not defined function'
|
- fixed 'not defined function'
|
||||||
|
* libraries/dbg/profiling.php:
|
||||||
|
- minor fixes: html output, speed, rtl lang
|
||||||
|
|
||||||
2005-11-01 Marc Delisle <lem9@users.sourceforge.net>
|
2005-11-01 Marc Delisle <lem9@users.sourceforge.net>
|
||||||
* server_privileges.php: undefined variable when changing a password
|
* server_privileges.php: undefined variable when changing a password
|
||||||
|
@@ -17,60 +17,55 @@ if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
|
|||||||
* LICENCE: This source file is subject to Mozilla Public License (MPL)
|
* LICENCE: This source file is subject to Mozilla Public License (MPL)
|
||||||
* AUTHOR: Dmitri Dmitrienko <dd@cron.ru>
|
* AUTHOR: Dmitri Dmitrienko <dd@cron.ru>
|
||||||
*/
|
*/
|
||||||
$dbg_prof_results = ""; // gma added var
|
dbg_get_profiler_results( $dbg_prof_results = '' );
|
||||||
dbg_get_profiler_results($dbg_prof_results);
|
|
||||||
$cwdlen = strlen(getcwd()); // gma added var, $cwdlen = strlen(getcwd());
|
$cwdlen = strlen(getcwd()); // gma added var, $cwdlen = strlen(getcwd());
|
||||||
echo '<br /><table width="1000" cellspacing="0" cellpadding="2" style="font:8pt courier">' . "\n" .
|
echo '<br /><table xml:lang="en" dir="ltr" width="1000" cellspacing="0" cellpadding="2" style="font:8pt courier">' . "\n" .
|
||||||
'<thead>' . "\n"; // gma change "." to ";"
|
'<thead>' . "\n";
|
||||||
$tr = '<tr style="background:#808080; color:#FFFFFF">' . "\n" . // gma added "$tr ="
|
// gma added "$tr ="
|
||||||
'<td>' . $GLOBALS['strDBGModule'] . '</td>' . "\n" .
|
$tr = '<tr>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGLine'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGModule'] . '</th>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGHits'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGLine'] . '</th>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGTimePerHitMs'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGHits'] . '</th>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGTotalTimeMs'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGTimePerHitMs'] . '</th>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGMinTimeMs'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGTotalTimeMs'] . '</th>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGMaxTimeMs'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGMinTimeMs'] . '</th>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGContextID'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGMaxTimeMs'] . '</th>' . "\n" .
|
||||||
'<td>' . $GLOBALS['strDBGContext'] . '</td>' . "\n" .
|
'<th>' . $GLOBALS['strDBGContextID'] . '</th>' . "\n" .
|
||||||
'</tr></thead>' . "\n"; // gma change "." to ";"
|
'<th>' . $GLOBALS['strDBGContext'] . '</th>' . "\n" .
|
||||||
echo $tr.'<tbody style="vertical-align: top">' . "\n"; $lines = 0; // gma added "echo $tr." and "$lines = 0;"
|
'</tr>' . "\n"; // gma change "." to ";"
|
||||||
foreach ($dbg_prof_results['line_no'] AS $idx => $line_no) { $lines++; // gma added "$lines++;"
|
echo $tr.'</thead><tbody style="vertical-align: top">' . "\n";
|
||||||
$mod_no = $dbg_prof_results['mod_no'][$idx];
|
$lines = 0; // gma added "echo $tr." and "$lines = 0;"
|
||||||
$mod_name = ""; // gma added var
|
$ctx_name = '';
|
||||||
dbg_get_module_name($mod_no, $mod_name);
|
$mod_name = '';
|
||||||
|
$ctx_id = '';
|
||||||
|
$odd_row = true;
|
||||||
|
foreach ( $dbg_prof_results['line_no'] as $idx => $line_no ) {
|
||||||
|
dbg_get_module_name( $dbg_prof_results['mod_no'][$idx], $mod_name );
|
||||||
|
|
||||||
//if (strpos("!".$mod_name, 'dbg.php') > 0) continue;
|
//if (strpos("!".$mod_name, 'dbg.php') > 0) continue;
|
||||||
|
|
||||||
$hit_cnt = $dbg_prof_results['hit_count'][$idx];
|
|
||||||
|
|
||||||
$time_sum = $dbg_prof_results['tm_sum'][$idx] * 1000;
|
$time_sum = $dbg_prof_results['tm_sum'][$idx] * 1000;
|
||||||
$time_avg_hit = $time_sum / $hit_cnt;
|
$time_avg_hit = $time_sum / $dbg_prof_results['hit_count'][$idx];
|
||||||
$time_min = $dbg_prof_results['tm_min'][$idx] * 1000;
|
|
||||||
$time_max = $dbg_prof_results['tm_max'][$idx] * 1000;
|
|
||||||
|
|
||||||
$time_sum = sprintf('%.3f', $time_sum);
|
$time_sum = sprintf( '%.3f', $time_sum );
|
||||||
$time_avg_hit = sprintf('%.3f', $time_avg_hit);
|
$time_avg_hit = sprintf('%.3f', $time_avg_hit);
|
||||||
$time_min = sprintf('%.3f', $time_min);
|
$time_min = sprintf( '%.3f', $dbg_prof_results['tm_min'][$idx] * 1000 );
|
||||||
$time_max = sprintf('%.3f', $time_max);
|
$time_max = sprintf( '%.3f', $dbg_prof_results['tm_max'][$idx] * 1000 );
|
||||||
$ctx_id = ""; // gma added var
|
dbg_get_source_context( $dbg_prof_results['mod_no'][$idx],
|
||||||
dbg_get_source_context($mod_no, $line_no, $ctx_id);
|
$line_no, $ctx_id );
|
||||||
|
|
||||||
//use a default context name if needed
|
// use a default context name if needed
|
||||||
$ctx_name = ""; // gma added var
|
if ( dbg_get_context_name( $ctx_id, $ctx_name )
|
||||||
if (dbg_get_context_name($ctx_id, $ctx_name)
|
&& strlen($ctx_name) == 0 ) {
|
||||||
&& strcmp($ctx_name,'') == 0) {
|
|
||||||
$ctx_name = "::main";
|
$ctx_name = "::main";
|
||||||
}
|
}
|
||||||
|
|
||||||
$bk = "#ffffff";
|
if ( $time_avg_hit > $GLOBALS['cfg']['DBG']['profile']['threshold'] ) {
|
||||||
if (($idx & 1) == 0)
|
echo '<tr class="' . $odd_row ? 'odd' : 'even' . '">' .
|
||||||
$bk = "#e0e0e0";
|
// gma changed "$mod_name" to "substr($mod_name,$cwdlen+1)"
|
||||||
|
'<td>' . substr($mod_name,$cwdlen+1) . '</td>' .
|
||||||
if ($time_avg_hit > $GLOBALS['cfg']['DBG']['profile']['threshold'] ) {
|
|
||||||
echo '<tr style="background:' . $bk . '">' .
|
|
||||||
'<td>' . substr($mod_name,$cwdlen+1) . '</td>' . // gma changed "$mod_name" to "substr($mod_name,$cwdlen+1)"
|
|
||||||
'<td>' . $line_no . '</td>' .
|
'<td>' . $line_no . '</td>' .
|
||||||
'<td>' . $hit_cnt . '</td>' .
|
'<td>' . $dbg_prof_results['hit_count'][$idx] . '</td>' .
|
||||||
'<td>' . $time_avg_hit . '</td>' .
|
'<td>' . $time_avg_hit . '</td>' .
|
||||||
'<td>' . $time_sum . '</td>' .
|
'<td>' . $time_sum . '</td>' .
|
||||||
'<td>' . $time_min . '</td>' .
|
'<td>' . $time_min . '</td>' .
|
||||||
@@ -78,17 +73,27 @@ if (isset($GLOBALS['DBG']) && $GLOBALS['DBG']
|
|||||||
'<td>' . $ctx_id . '</td>' .
|
'<td>' . $ctx_id . '</td>' .
|
||||||
'<td>' . $ctx_name . '</td>' .
|
'<td>' . $ctx_name . '</td>' .
|
||||||
'</tr>' . "\n";
|
'</tr>' . "\n";
|
||||||
if($lines == 20) { $lines = 0; echo $tr;} // gma added line. Repeats the header every x lines.
|
|
||||||
|
// gma added line. Repeats the header every x lines.
|
||||||
|
if ( $lines === 19 ) {
|
||||||
|
$odd_row = true;
|
||||||
|
$lines = 0;
|
||||||
|
echo $tr;
|
||||||
|
} else {
|
||||||
|
$odd_row = ! $odd_row;
|
||||||
|
$lines++;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</tbody></table>";
|
echo '</tbody></table>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
/* gma ... Developer Notes
|
/* gma ... Developer Notes
|
||||||
These two scriptlets can be used as On/Off buttons in your browsers, add to links.
|
These two scriptlets can be used as On/Off buttons in your browsers, add to links.
|
||||||
ON:
|
ON:
|
||||||
javascript: document.cookie = 'DBGSESSID=' + escape('1;d=1,p=1') + '; path=/'; document.execCommand('refresh');
|
javascript: document.cookie = 'DBGSESSID=' + escape('1;d=1,p=1') + '; path=/'; document.execCommand('refresh');
|
||||||
or ... javascript: document.cookie = 'DBGSESSID=' + escape('1;d=0,p=1') + '; path=/'; document.execCommand('refresh');
|
or ...
|
||||||
|
javascript: document.cookie = 'DBGSESSID=' + escape('1;d=0,p=1') + '; path=/'; document.execCommand('refresh');
|
||||||
OFF:
|
OFF:
|
||||||
javascript: document.cookie = 'DBGSESSID=' + escape('1;d=0,p=0') + '; path=/'; document.execCommand('refresh');
|
javascript: document.cookie = 'DBGSESSID=' + escape('1;d=0,p=0') + '; path=/'; document.execCommand('refresh');
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user