1212use Symfony \Component \EventDispatcher \EventSubscriberInterface ;
1313use Symfony \Contracts \Service \ResetInterface ;
1414
15- final class Neo4jProfileListener implements EventSubscriberInterface, ResetInterface
15+ class Neo4jProfileListener implements EventSubscriberInterface, ResetInterface
1616{
1717 /**
1818 * @var list<array{
19+ * alias: null|string,
20+ * end_time: float|int,
1921 * result: ResultSummary,
20- * alias: string|null,
21- * time: string,
2222 * start_time: float|int,
23- * end_time: float|int
23+ * time: string,
24+ * scheme?: null|string,
25+ * transaction_id?: null|string
2426 * }>
2527 */
2628 private array $ profiledSummaries = [];
@@ -53,13 +55,16 @@ public static function getSubscribedEvents(): array
5355
5456 public function onPostRun (PostRunEvent $ event ): void
5557 {
56- if (in_array ($ event ->getAlias () , $ this ->enabledProfiles )) {
57- $ time = $ event ->getTime () ;
58- $ result = $ event ->getResult () ;
58+ if (in_array ($ event ->alias , $ this ->enabledProfiles )) {
59+ $ time = $ event ->time ;
60+ $ result = $ event ->result ;
5961 $ end_time = $ time ->getTimestamp () + $ result ->getResultAvailableAfter () + $ result ->getResultConsumedAfter ();
62+
6063 $ this ->profiledSummaries [] = [
61- 'result ' => $ event ->getResult (),
62- 'alias ' => $ event ->getAlias (),
64+ 'result ' => $ result ,
65+ 'alias ' => $ event ->alias ,
66+ 'scheme ' => $ event ->scheme ,
67+ 'transaction_id ' => $ event ->transactionId ,
6368 'time ' => $ time ->format ('Y-m-d H:i:s ' ),
6469 'start_time ' => $ time ->getTimestamp (),
6570 'end_time ' => $ end_time ,
@@ -69,12 +74,12 @@ public function onPostRun(PostRunEvent $event): void
6974
7075 public function onFailure (FailureEvent $ event ): void
7176 {
72- if (in_array ($ event ->getAlias () , $ this ->enabledProfiles )) {
73- $ time = $ event ->getTime () ;
77+ if (in_array ($ event ->alias , $ this ->enabledProfiles )) {
78+ $ time = $ event ->time ;
7479 $ this ->profiledFailures [] = [
75- 'exception ' => $ event ->getException () ,
76- 'statement ' => $ event ->getStatement () ,
77- 'alias ' => $ event ->getAlias () ,
80+ 'exception ' => $ event ->exception ,
81+ 'statement ' => $ event ->statement ,
82+ 'alias ' => $ event ->alias ,
7883 'time ' => $ time ->format ('Y-m-d H:i:s ' ),
7984 'timestamp ' => $ time ->getTimestamp (),
8085 ];
0 commit comments