add execution time; remove logger preffix; add as second parameter

This commit is contained in:
Gordon Franke 2011-10-04 17:46:27 +02:00
commit d17bd572da
3 changed files with 22 additions and 12 deletions

View file

@ -18,10 +18,14 @@ class Client extends Elastica_Client
public function request($path, $method, $data = array())
{
$start = microtime(true);
$response = parent::request($path, $method, $data);
if (null !== $this->logger) {
$this->logger->logQuery($path, $method, $data);
$time = microtime(true) - $start;
$this->logger->logQuery($path, $method, $data, $time);
}
return parent::request($path, $method, $data);
return $response;
}
}