private function BenchmarkCommand::getData in Devel 8.2
Same name and namespace in other branches
- 8.3 webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getData()
- 8 webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getData()
- 4.x webprofiler/src/Command/BenchmarkCommand.php \Drupal\webprofiler\Command\BenchmarkCommand::getData()
Parameters
\GuzzleHttp\ClientInterface $client:
$url:
Return value
array
1 call to BenchmarkCommand::getData()
- BenchmarkCommand::execute in webprofiler/
src/ Command/ BenchmarkCommand.php - Executes the current command.
File
- webprofiler/
src/ Command/ BenchmarkCommand.php, line 157
Class
- BenchmarkCommand
- Class BenchmarkCommand
Namespace
Drupal\webprofiler\CommandCode
private function getData(ClientInterface $client, $url) {
/** @var \GuzzleHttp\Message\ResponseInterface $response */
$response = $client
->get($url);
$token = $response
->getHeader('X-Debug-Token');
/** @var \Drupal\webprofiler\Profiler\Profiler $profiler */
$profiler = $this->container
->get('profiler');
/** @var \Symfony\Component\HttpKernel\Profiler\Profile $profile */
$profile = $profiler
->loadProfile($token);
/** @var \Drupal\webprofiler\DataCollector\TimeDataCollector $timeDataCollector */
$timeDataCollector = $profile
->getCollector('time');
return new BenchmarkData($token, $timeDataCollector
->getMemory(), $timeDataCollector
->getDuration());
}