Skip to content
Snippets Groups Projects
Commit 45155b49 authored by hahn's avatar hahn
Browse files

add memory in debug

parent 2c8a557c
No related branches found
No related tags found
1 merge request!195534 add docker
...@@ -8,6 +8,7 @@ ...@@ -8,6 +8,7 @@
class logger { class logger {
protected $aMessages=array(); protected $aMessages=array();
protected $bShowDebug=true; protected $bShowDebug=true;
protected $_iMemStart = false;
/** /**
...@@ -16,6 +17,7 @@ class logger { ...@@ -16,6 +17,7 @@ class logger {
* @return boolean * @return boolean
*/ */
public function __construct($sInitMessage="Logger was initialized.") { public function __construct($sInitMessage="Logger was initialized.") {
$this->_iMemStart=memory_get_usage();
$this->add($sInitMessage); $this->add($sInitMessage);
return true; return true;
} }
...@@ -31,7 +33,7 @@ class logger { ...@@ -31,7 +33,7 @@ class logger {
/** /**
* enable client debugging by a given array of allowed ip addresses * enable client debugging by a given array of allowed ip addresses
* @param type $aIpArray * @param array $aIpArray
* @return boolean * @return boolean
*/ */
public function enableDebugByIp($aIpArray){ public function enableDebugByIp($aIpArray){
...@@ -75,6 +77,12 @@ class logger { ...@@ -75,6 +77,12 @@ class logger {
return false; return false;
} }
$sOut=''; $sOut='';
$iMem=memory_get_usage();
$this->add('<hr>');
$this->add('Memory on start: ' . number_format($this->_iMemStart, 0, '.', ',') . " bytes");
$this->add('Memory on end: ' . number_format($iMem, 0, '.', ',') . " bytes");
$this->add('Memory peak: ' . number_format(memory_get_peak_usage(), 0, '.', ',') . " bytes");
$sStarttime=$this->aMessages[0]["time"]; $sStarttime=$this->aMessages[0]["time"];
$iCounter=0; $iCounter=0;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment