Пример #1
0
 public function post(Trace $trace, $url, $data)
 {
     try {
         $this->timer->reset();
         $result = $this->delegate->post($trace, $url, $data);
         $this->stats->addStats(0, strlen($result), $this->timer->getElapsedTime());
         return $result;
     } catch (Exception $e) {
         $this->stats->addStats(1, 0, $this->timer->getElapsedTime());
         throw $e;
     }
 }
Пример #2
0
 private function processStatistics($curl)
 {
     $size = curl_getinfo($curl, CURLINFO_SIZE_DOWNLOAD) + curl_getinfo($curl, CURLINFO_HEADER_SIZE);
     $time = curl_getinfo($curl, CURLINFO_TOTAL_TIME);
     $errors = curl_errno($curl) ? 1 : 0;
     $this->stats->addStats($errors, $size, $time);
 }