You are here

public function TimeDataCollector::collect in Zircon Profile 8.0

Same name and namespace in other branches
  1. 8 vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php \Symfony\Component\HttpKernel\DataCollector\TimeDataCollector::collect()

Collects data for the given Request and Response.

Parameters

Request $request A Request instance:

Response $response A Response instance:

\Exception $exception An Exception instance:

Overrides DataCollectorInterface::collect

File

vendor/symfony/http-kernel/DataCollector/TimeDataCollector.php, line 37

Class

TimeDataCollector
TimeDataCollector.

Namespace

Symfony\Component\HttpKernel\DataCollector

Code

public function collect(Request $request, Response $response, \Exception $exception = null) {
  if (null !== $this->kernel) {
    $startTime = $this->kernel
      ->getStartTime();
  }
  else {
    $startTime = $request->server
      ->get('REQUEST_TIME_FLOAT', $request->server
      ->get('REQUEST_TIME'));
  }
  $this->data = array(
    'token' => $response->headers
      ->get('X-Debug-Token'),
    'start_time' => $startTime * 1000,
    'events' => array(),
  );
}