Update the profiles with the timing and events information and saves them.
Profile $profile The root profile:
Boolean $updateChildren Whether to update the children altogether:
private function saveInfoInProfile(Profile $profile, $updateChildren) {
try {
$collector = $profile
->getCollector('memory');
$collector
->updateMemoryUsage();
} catch (\InvalidArgumentException $e) {
}
try {
$collector = $profile
->getCollector('time');
$collector
->setEvents($this->stopwatch
->getSectionEvents($profile
->getToken()));
} catch (\InvalidArgumentException $e) {
}
try {
$collector = $profile
->getCollector('events');
$collector
->setCalledListeners($this
->getCalledListeners());
$collector
->setNotCalledListeners($this
->getNotCalledListeners());
} catch (\InvalidArgumentException $e) {
}
$this->profiler
->saveProfile($profile);
if ($updateChildren) {
foreach ($profile
->getChildren() as $child) {
$this
->saveInfoInProfile($child, true);
}
}
}