more debug for times; try to minimize old openConnection calls

This commit is contained in:
Klaus Leithoff 2014-02-27 15:32:14 +00:00
parent 910e696c38
commit 2a55cfd281
2 changed files with 12 additions and 8 deletions

View File

@ -675,7 +675,7 @@ class mail_bo
*/ */
function reopen($_foldername) function reopen($_foldername)
{ {
if (self::$debug||self::$debugTimes) $starttime = microtime (true); if (self::$debugTimes) $starttime = microtime (true);
//error_log(__METHOD__.__LINE__."('$_foldername') ".function_backtrace()); //error_log(__METHOD__.__LINE__."('$_foldername') ".function_backtrace());
// TODO: trying to reduce traffic to the IMAP Server here, introduces problems with fetching the bodies of // TODO: trying to reduce traffic to the IMAP Server here, introduces problems with fetching the bodies of
@ -690,7 +690,7 @@ class mail_bo
} }
$folderOpened = $_foldername; $folderOpened = $_foldername;
//} //}
if (self::$debug||self::$debugTimes) self::logRunTimes($starttime,null,'Folder:'.$_folderName,__METHOD__.__LINE__); if (self::$debugTimes) self::logRunTimes($starttime,null,'Folder:'.$_foldername,__METHOD__.__LINE__);
} }
@ -5045,7 +5045,7 @@ class mail_bo
{ {
if (is_null($_endtime)) $_endtime = microtime(true); if (is_null($_endtime)) $_endtime = microtime(true);
$usagetime = microtime(true) - $_starttime; $usagetime = microtime(true) - $_starttime;
if (self::$debugTimes) error_log($_methodNline.' took:'.$usagetime.'(s) '.($_message?'Details:'.$_message:'')); if (self::$debugTimes) error_log($_methodNline.' took:'.number_format($usagetime,5).'(s) '.($_message?'Details:'.$_message:''));
} }
/** /**

View File

@ -101,7 +101,7 @@ class mail_ui
*/ */
function __construct() function __construct()
{ {
//$starttime = microtime (true); if (mail_bo::$debugTimes) $starttime = microtime (true);
if (!isset($GLOBALS['egw_info']['flags']['js_link_registry'])) if (!isset($GLOBALS['egw_info']['flags']['js_link_registry']))
{ {
//error_log(__METHOD__.__LINE__.' js_link_registry not set, force it:'.array2string($GLOBALS['egw_info']['flags']['js_link_registry'])); //error_log(__METHOD__.__LINE__.' js_link_registry not set, force it:'.array2string($GLOBALS['egw_info']['flags']['js_link_registry']));
@ -128,8 +128,11 @@ class mail_ui
if (mail_bo::$debug) error_log(__METHOD__.__LINE__.' Fetched IC Server:'.self::$icServerID.'/'.$this->mail_bo->profileID.':'.function_backtrace()); if (mail_bo::$debug) error_log(__METHOD__.__LINE__.' Fetched IC Server:'.self::$icServerID.'/'.$this->mail_bo->profileID.':'.function_backtrace());
//error_log(__METHOD__.__LINE__.array2string($this->mail_bo->icServer)); //error_log(__METHOD__.__LINE__.array2string($this->mail_bo->icServer));
//error_log(__METHOD__.__LINE__.array2string($this->mail_bo->icServer->ImapServerId)); //error_log(__METHOD__.__LINE__.array2string($this->mail_bo->icServer->ImapServerId));
//openConnection gathers SpecialUseFolderInformation and Delimiter Info if ($_GET['menuaction'] != 'mail.etemplate_widget_nextmatch.ajax_get_rows.etemplate')
$this->mail_bo->openConnection(self::$icServerID); {
//openConnection gathers SpecialUseFolderInformation and Delimiter Info
$this->mail_bo->openConnection(self::$icServerID);
}
} }
catch (Exception $e) catch (Exception $e)
{ {
@ -147,8 +150,7 @@ class mail_ui
//$GLOBALS['egw']->session->commit_session(); //$GLOBALS['egw']->session->commit_session();
//_debug_array($this->mail_bo->mailPreferences); //_debug_array($this->mail_bo->mailPreferences);
//$endtime = microtime(true) - $starttime; if (mail_bo::$debugTimes) mail_bo::logRunTimes($starttime,null,'',__METHOD__.__LINE__);
//error_log(__METHOD__.__LINE__. " time used: ".$endtime);
} }
/** /**
@ -158,6 +160,7 @@ class mail_ui
*/ */
function changeProfile($_icServerID,$unsetCache=false) function changeProfile($_icServerID,$unsetCache=false)
{ {
if (mail_bo::$debugTimes) $starttime = microtime (true);
if (self::$icServerID != $_icServerID) if (self::$icServerID != $_icServerID)
{ {
} }
@ -176,6 +179,7 @@ class mail_ui
$GLOBALS['egw']->preferences->add('mail','ActiveProfileID',self::$icServerID,'user'); $GLOBALS['egw']->preferences->add('mail','ActiveProfileID',self::$icServerID,'user');
$GLOBALS['egw']->preferences->save_repository(true); $GLOBALS['egw']->preferences->save_repository(true);
$GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = self::$icServerID; $GLOBALS['egw_info']['user']['preferences']['mail']['ActiveProfileID'] = self::$icServerID;
if (mail_bo::$debugTimes) mail_bo::logRunTimes($starttime,null,'',__METHOD__.__LINE__);
} }
/** /**
* Subscribe or Unsubscribe to a folder * Subscribe or Unsubscribe to a folder