7
7
* @property {string } address The address (host/port pair) of the pool
8
8
*/
9
9
class ConnectionPoolMonitoringEvent {
10
- constructor ( type , pool ) {
10
+ constructor ( pool ) {
11
11
this . time = new Date ( ) ;
12
- this . type = type ;
13
12
this . address = pool . address ;
14
13
}
15
14
}
@@ -21,7 +20,7 @@ class ConnectionPoolMonitoringEvent {
21
20
*/
22
21
class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent {
23
22
constructor ( pool ) {
24
- super ( 'ConnectionPoolCreated' , pool ) ;
23
+ super ( pool ) ;
25
24
this . options = pool . options ;
26
25
}
27
26
}
@@ -31,7 +30,7 @@ class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent {
31
30
*/
32
31
class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent {
33
32
constructor ( pool ) {
34
- super ( 'ConnectionPoolClosed' , pool ) ;
33
+ super ( pool ) ;
35
34
}
36
35
}
37
36
@@ -42,7 +41,7 @@ class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent {
42
41
*/
43
42
class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent {
44
43
constructor ( pool , connection ) {
45
- super ( 'ConnectionCreated' , pool ) ;
44
+ super ( pool ) ;
46
45
this . connectionId = connection . id ;
47
46
}
48
47
}
@@ -54,7 +53,7 @@ class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent {
54
53
*/
55
54
class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent {
56
55
constructor ( pool , connection ) {
57
- super ( 'ConnectionReady' , pool ) ;
56
+ super ( pool ) ;
58
57
this . connectionId = connection . id ;
59
58
}
60
59
}
@@ -67,7 +66,7 @@ class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent {
67
66
*/
68
67
class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent {
69
68
constructor ( pool , connection , reason ) {
70
- super ( 'ConnectionClosed' , pool ) ;
69
+ super ( pool ) ;
71
70
this . connectionId = connection . id ;
72
71
this . reason = reason || 'unknown' ;
73
72
}
@@ -78,7 +77,7 @@ class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent {
78
77
*/
79
78
class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent {
80
79
constructor ( pool ) {
81
- super ( 'ConnectionCheckOutStarted' , pool ) ;
80
+ super ( pool ) ;
82
81
}
83
82
}
84
83
@@ -89,7 +88,7 @@ class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEvent {
89
88
*/
90
89
class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent {
91
90
constructor ( pool , reason ) {
92
- super ( 'ConnectionCheckOutFailed' , pool ) ;
91
+ super ( pool ) ;
93
92
this . reason = reason ;
94
93
}
95
94
}
@@ -101,7 +100,7 @@ class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent {
101
100
*/
102
101
class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent {
103
102
constructor ( pool , connection ) {
104
- super ( 'ConnectionCheckedOut' , pool ) ;
103
+ super ( pool ) ;
105
104
this . connectionId = connection . id ;
106
105
}
107
106
}
@@ -113,7 +112,7 @@ class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent {
113
112
*/
114
113
class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent {
115
114
constructor ( pool , connection ) {
116
- super ( 'ConnectionCheckedIn' , pool ) ;
115
+ super ( pool ) ;
117
116
this . connectionId = connection . id ;
118
117
}
119
118
}
@@ -123,7 +122,7 @@ class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent {
123
122
*/
124
123
class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent {
125
124
constructor ( pool ) {
126
- super ( 'ConnectionPoolCleared' , pool ) ;
125
+ super ( pool ) ;
127
126
}
128
127
}
129
128
0 commit comments