Skip to content

Commit

Permalink
Implementing reset method in Neo4jDataCollector (#43)
Browse files Browse the repository at this point in the history
* implementing reset method in datacollector

* resetting the query logger

* removed docblocks as suggested by styleci

* removed empty spaces
  • Loading branch information
angelov authored and Nyholm committed Jan 22, 2018
1 parent b6846de commit 800a060
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
6 changes: 6 additions & 0 deletions Collector/Neo4jDataCollector.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,12 @@ public function collect(Request $request, Response $response, \Exception $except
});
}

public function reset()
{
$this->data = [];
$this->queryLogger->reset();
}

/**
* @return int
*/
Expand Down
7 changes: 7 additions & 0 deletions Collector/QueryLogger.php
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,13 @@ public function finish(StatementResultInterface $statementResult)
]);
}

public function reset()
{
$this->nbQueries = 0;
$this->statements = [];
$this->statementsHash = [];
}

/**
* @param Neo4jExceptionInterface $exception
*/
Expand Down

0 comments on commit 800a060

Please sign in to comment.