コード例 #1
0
 /**
  * Convenience wrapper to publishes the request, while proxying any response Wildfire headers
  *
  * @param GuzzleHttp\Event\EndEvent $event
  * @param float $timing
  */
 public function run(EndEvent $event, $timing)
 {
     $response = $event->getResponse();
     $this->publishRequest($event->getRequest(), $response, $timing);
     $this->proxyResponseHeaders($response);
 }
コード例 #2
0
ファイル: Stopwatch.php プロジェクト: campru/guzzle-bundle
 /**
  * Manage the event emitted when a request transaction has ended.
  *
  * @param EndEvent $event Event emitted.
  */
 public function onEnd(EndEvent $event)
 {
     $response = $event->getResponse();
     $data = ['total' => $event->getTransferInfo('total_time'), 'connection' => $event->getTransferInfo('connect_time')];
     $this->storage->attach($response, $data);
 }