private function TraceableEventDispatcher::saveInfoInProfile

Update the profiles with the timing and events information and saves them.

Parameters

Profile $profile The root profile:

Boolean $updateChildren Whether to update the children altogether:

1 call to TraceableEventDispatcher::saveInfoInProfile()
TraceableEventDispatcher::updateProfiles in drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php
Updates the stopwatch data in the profile hierarchy.

File

drupal/core/vendor/symfony/http-kernel/Symfony/Component/HttpKernel/Debug/TraceableEventDispatcher.php, line 337

Class

TraceableEventDispatcher
Collects some data about event listeners.

Namespace

Symfony\Component\HttpKernel\Debug

Code

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);
    }
  }
}