mirror of
https://github.com/e107inc/e107.git
synced 2025-01-17 12:48:24 +01:00
Debug timings.
This commit is contained in:
parent
15c586b5dc
commit
d7fad829fe
@ -69,10 +69,10 @@ require_once(e_ADMIN.'boot.php');
|
||||
require_once(e_ADMIN.'auth.php');
|
||||
require_once(e_HANDLER.'upload_handler.php');
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(Start Admin Checks)');
|
||||
new admin_start;
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(After Admin Checks)');
|
||||
$mes = e107::getMessage();
|
||||
|
||||
if (!isset($pref['adminstyle'])) $pref['adminstyle'] = 'infopanel'; // Shouldn't be needed - but just in case
|
||||
@ -153,8 +153,10 @@ class admin_start
|
||||
|
||||
e107::getDb()->db_Mark_Time('Check Paths');
|
||||
$this->checkPaths();
|
||||
|
||||
e107::getDb()->db_Mark_Time('Check Timezone');
|
||||
$this->checkTimezone();
|
||||
|
||||
e107::getDb()->db_Mark_Time('Check Writable');
|
||||
$this->checkWritable();
|
||||
|
||||
|
@ -19,6 +19,9 @@ if (!defined('e107_INIT'))
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(Start auth.php)');
|
||||
|
||||
define('e_CAPTCHA_FONTCOLOR','#F9A533');
|
||||
|
||||
|
||||
|
@ -15,7 +15,7 @@ if (!defined('e107_INIT'))
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
e107::getDb()->db_Mark_Time('(Start boot.php)');
|
||||
header('Content-type: text/html; charset=utf-8', TRUE);
|
||||
|
||||
define('ADMINFEED', 'https://e107.org/adminfeed');
|
||||
|
@ -176,6 +176,7 @@ class e107Update
|
||||
{
|
||||
$mes = e107::getMessage();
|
||||
$tp = e107::getParser();
|
||||
$sql = e107::getDb();
|
||||
|
||||
|
||||
// foreach($this->core as $func => $data)
|
||||
@ -258,6 +259,7 @@ class e107Update
|
||||
{
|
||||
$frm = e107::getForm();
|
||||
$mes = e107::getMessage();
|
||||
$sql = e107::getDb();
|
||||
|
||||
$text = "";
|
||||
|
||||
@ -373,8 +375,11 @@ function update_check()
|
||||
|
||||
foreach($dbupdate as $func => $rmks) // See which core functions need update
|
||||
{
|
||||
|
||||
if (function_exists('update_'.$func))
|
||||
{
|
||||
|
||||
$sql->db_Mark_Time('Check Core Update_'.$func.' ');
|
||||
if (!call_user_func('update_'.$func, FALSE))
|
||||
{
|
||||
$update_needed = TRUE;
|
||||
@ -388,6 +393,7 @@ function update_check()
|
||||
{
|
||||
if (function_exists('update_'.$func))
|
||||
{
|
||||
// $sql->db_Mark_Time('Check Core Update_'.$func.' ');
|
||||
if (!call_user_func('update_'.$func, FALSE))
|
||||
{
|
||||
$update_needed = TRUE;
|
||||
@ -588,6 +594,7 @@ function update_core_database($type = '')
|
||||
//--------------------------------------------
|
||||
function update_706_to_800($type='')
|
||||
{
|
||||
|
||||
global $pref, $e107info;
|
||||
global $sysprefs, $eArrayStorage;
|
||||
|
||||
@ -1744,6 +1751,7 @@ function core_media_import($cat,$epath)
|
||||
|
||||
function update_70x_to_706($type='')
|
||||
{
|
||||
|
||||
global $sql,$ns, $pref, $e107info, $admin_log, $emessage;
|
||||
|
||||
$just_check = $type == 'do' ? FALSE : TRUE;
|
||||
|
@ -352,8 +352,8 @@ class e107_db_debug {
|
||||
}
|
||||
|
||||
|
||||
function Show_Performance()
|
||||
{
|
||||
function Show_Performance()
|
||||
{
|
||||
//
|
||||
// Stats by Time Marker
|
||||
//
|
||||
@ -382,6 +382,24 @@ class e107_db_debug {
|
||||
$aSum['DB Count'] = 0;
|
||||
$aSum['Memory'] = 0;
|
||||
|
||||
// Calculate Memory Usage per entry.
|
||||
$prevMem = 0;
|
||||
|
||||
foreach($this->aTimeMarks as $k=>$v)
|
||||
{
|
||||
|
||||
$prevKey = $k-1;
|
||||
|
||||
if(!empty($prevKey))
|
||||
{
|
||||
$this->aTimeMarks[$prevKey]['Memory Used'] = (intval($v['Memory']) - $prevMem);
|
||||
}
|
||||
|
||||
$prevMem = intval($v['Memory']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
while(list($tKey, $tMarker) = each($this->aTimeMarks))
|
||||
{
|
||||
if(!$bRowHeaders)
|
||||
@ -405,27 +423,32 @@ class e107_db_debug {
|
||||
}
|
||||
$aUnits['OB Lev'] = 'lev(buf bytes)';
|
||||
$aUnits['Memory'] = '(kb)';
|
||||
$aUnits['Memory Used'] = '(kb)';
|
||||
$text .= "<tr><td class='fcaption' style='text-align:right'><b>" . implode("</b> </td><td class='fcaption' style='text-align:right'><b>", $aUnits) . "</b> </td></tr>\n";
|
||||
}
|
||||
|
||||
|
||||
|
||||
$tMem = ($tMarker['Memory'] - $aSum['Memory']);
|
||||
// $tMem = ($tMarker['Memory'] - $aSum['Memory']);
|
||||
|
||||
$tMem = ($tMarker['Memory']);
|
||||
|
||||
if($tMem < 0) // Quick Fix for negative numbers.
|
||||
{
|
||||
$tMem = 0.0000000001;
|
||||
// $tMem = 0.0000000001;
|
||||
}
|
||||
|
||||
$tMarker['Memory'] = ($tMem ? number_format($tMem / 1024.0, 1) : '?'); // display if known
|
||||
|
||||
$tUsage = $tMarker['Memory Used'];
|
||||
$tMarker['Memory Used'] = number_format($tUsage / 1024.0, 1);
|
||||
|
||||
if($tMem > 400000) // Highlight high memory usage.
|
||||
if($tUsage > 400000) // Highlight high memory usage.
|
||||
{
|
||||
$tMarker['Memory'] = "<span class='label label-danger'>".$tMarker['Memory']."</span>";
|
||||
$tMarker['Memory Used'] = "<span class='label label-danger'>".$tMarker['Memory Used']."</span>";
|
||||
}
|
||||
|
||||
$aSum['Memory'] += $tMem;
|
||||
// $aSum['Memory'] += $tMem;
|
||||
|
||||
if($tMarker['What'] == 'Stop')
|
||||
{
|
||||
|
@ -1310,7 +1310,7 @@ class e_parse_shortcode
|
||||
|
||||
if (E107_DBG_SC || E107_DBG_TIMEDETAILS)
|
||||
{
|
||||
$sql->db_Mark_Time("(After SC {$code})");
|
||||
// $sql->db_Mark_Time("(After SC {$code})");
|
||||
}
|
||||
|
||||
if (($noDebugLog != true) && (E107_DBG_BBSC || E107_DBG_SC || E107_DBG_TIMEDETAILS))
|
||||
|
Loading…
x
Reference in New Issue
Block a user