44
55namespace Neo4j \Neo4jBundle \Collector ;
66
7+ use GraphAware \Bolt \Result \Result ;
78use GraphAware \Common \Cypher \StatementInterface ;
89use GraphAware \Common \Result \StatementResult as StatementResultInterface ;
910use GraphAware \Common \Result \StatementStatisticsInterface ;
11+ use GraphAware \Neo4j \Client \Exception \Neo4jExceptionInterface ;
1012
1113/**
1214 * @author Xavier Coureau <[email protected] > @@ -59,6 +61,11 @@ public function record(StatementInterface $statement)
5961 */
6062 public function finish (StatementResultInterface $ statementResult )
6163 {
64+ $ scheme = 'Http ' ;
65+ if ($ statementResult instanceof Result) {
66+ $ scheme = 'Bolt ' ;
67+ }
68+
6269 $ statement = $ statementResult ->statement ();
6370 $ statementText = $ statement ->text ();
6471 $ statementParams = $ statement ->parameters ();
@@ -77,9 +84,18 @@ public function finish(StatementResultInterface $statementResult)
7784 'end_time ' => microtime (true ) * 1000 ,
7885 'nb_results ' => $ statementResult ->size (),
7986 'statistics ' => $ this ->statisticsToArray ($ statementResult ->summarize ()->updateStatistics ()),
87+ 'scheme ' => $ scheme ,
8088 ]);
8189 }
8290
91+ /**
92+ * @param Neo4jExceptionInterface $exception
93+ */
94+ public function logException (Neo4jExceptionInterface $ exception )
95+ {
96+ // TODO log exceptions
97+ }
98+
8399 /**
84100 * {@inheritdoc}
85101 */
@@ -138,7 +154,7 @@ private function statisticsToArray(StatementStatisticsInterface $statementStatis
138154 'constraints_added ' => $ statementStatistics ->constraintsAdded (),
139155 'constraints_removed ' => $ statementStatistics ->constraintsRemoved (),
140156 ];
141-
157+
142158 return $ data ;
143159 }
144160}
0 commit comments