add params & trace & profile

This commit is contained in:
evgen-d
2014-08-04 15:11:29 +04:00
parent 39f2888f6b
commit 30c38fa3a4
3 changed files with 123 additions and 11 deletions

View File

@@ -2,6 +2,7 @@
namespace devgroup\arangodb;
use Yii;
use triagens\ArangoDb\CollectionHandler;
use triagens\ArangoDb\ConnectionOptions;
use triagens\ArangoDb\Document;
@@ -46,9 +47,18 @@ class Connection extends Object
{
parent::init();
$this->connection = new ArangoDbConnection($this->connectionOptions);
$this->collectionHandler = new CollectionHandler($this->connection);
$this->documentHandler = new DocumentHandler($this->connection);
$token = 'Opening ArangoDB connection: ' . $this->connectionOptions[ConnectionOptions::OPTION_ENDPOINT];
try {
Yii::info($token, __METHOD__);
Yii::beginProfile($token, __METHOD__);
$this->connection = new ArangoDbConnection($this->connectionOptions);
$this->collectionHandler = new CollectionHandler($this->connection);
$this->documentHandler = new DocumentHandler($this->connection);
Yii::endProfile($token, __METHOD__);
} catch (\Exception $ex) {
Yii::endProfile($token, __METHOD__);
throw new \Exception($ex->getMessage(), (int) $ex->getCode(), $ex);
}
}
/**