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

add memory in debug

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