CC-4265: Keep track of how much memory each request is taking and log if over a threshold

-fixed
This commit is contained in:
Martin Konecny 2012-08-22 14:01:44 -04:00
parent ea4567f373
commit cef3ffb07b
1 changed files with 8 additions and 0 deletions

View File

@ -11,5 +11,13 @@ class RabbitMqPlugin extends Zend_Controller_Plugin_Abstract
Application_Model_RabbitMq::SendMessageToShowRecorder("update_recorder_schedule");
}
}
if (memory_get_peak_usage() > 25*pow(2, 20)) {
Logging::debug("Peak memory usage: "
.(memory_get_peak_usage()/1000000)
." MB while accessing URI ".$_SERVER['REQUEST_URI']);
Logging::debug("Should try to keep memory footprint under 25 MB");
}
}
}