@@ -14,19 +14,25 @@ import (
14
14
15
15
type monitoringEventType string
16
16
17
+ // monitoringEventTypes poolReadyEvent and connectionCheckOutStartedEvent are included
18
+ // to support logging in the atlas planned maintenance executor, which stores events
19
+ // without making assertions on them. The matching published event types will be
20
+ // created in GODRIVER-1827
17
21
const (
18
- commandStartedEvent monitoringEventType = "CommandStartedEvent"
19
- commandSucceededEvent monitoringEventType = "CommandSucceededEvent"
20
- commandFailedEvent monitoringEventType = "CommandFailedEvent"
21
- poolCreatedEvent monitoringEventType = "PoolCreatedEvent"
22
- poolClearedEvent monitoringEventType = "PoolClearedEvent"
23
- poolClosedEvent monitoringEventType = "PoolClosedEvent"
24
- connectionCreatedEvent monitoringEventType = "ConnectionCreatedEvent"
25
- connectionReadyEvent monitoringEventType = "ConnectionReadyEvent"
26
- connectionClosedEvent monitoringEventType = "ConnectionClosedEvent"
27
- connectionCheckOutFailedEvent monitoringEventType = "ConnectionCheckOutFailedEvent"
28
- connectionCheckedOutEvent monitoringEventType = "ConnectionCheckedOutEvent"
29
- connectionCheckedInEvent monitoringEventType = "ConnectionCheckedInEvent"
22
+ commandStartedEvent monitoringEventType = "CommandStartedEvent"
23
+ commandSucceededEvent monitoringEventType = "CommandSucceededEvent"
24
+ commandFailedEvent monitoringEventType = "CommandFailedEvent"
25
+ poolCreatedEvent monitoringEventType = "PoolCreatedEvent"
26
+ poolReadyEvent monitoringEventType = "PoolReadyEvent"
27
+ poolClearedEvent monitoringEventType = "PoolClearedEvent"
28
+ poolClosedEvent monitoringEventType = "PoolClosedEvent"
29
+ connectionCreatedEvent monitoringEventType = "ConnectionCreatedEvent"
30
+ connectionReadyEvent monitoringEventType = "ConnectionReadyEvent"
31
+ connectionClosedEvent monitoringEventType = "ConnectionClosedEvent"
32
+ connectionCheckOutStartedEvent monitoringEventType = "ConnectionCheckOutStartedEvent"
33
+ connectionCheckOutFailedEvent monitoringEventType = "ConnectionCheckOutFailedEvent"
34
+ connectionCheckedOutEvent monitoringEventType = "ConnectionCheckedOutEvent"
35
+ connectionCheckedInEvent monitoringEventType = "ConnectionCheckedInEvent"
30
36
)
31
37
32
38
func monitoringEventTypeFromString (eventStr string ) (monitoringEventType , bool ) {
@@ -39,6 +45,8 @@ func monitoringEventTypeFromString(eventStr string) (monitoringEventType, bool)
39
45
return commandFailedEvent , true
40
46
case "poolcreatedevent" :
41
47
return poolCreatedEvent , true
48
+ case "poolreadyevent" :
49
+ return poolReadyEvent , true
42
50
case "poolclearedevent" :
43
51
return poolClearedEvent , true
44
52
case "poolclosedevent" :
@@ -49,6 +57,8 @@ func monitoringEventTypeFromString(eventStr string) (monitoringEventType, bool)
49
57
return connectionReadyEvent , true
50
58
case "connectionclosedevent" :
51
59
return connectionClosedEvent , true
60
+ case "connectioncheckoutstartedevent" :
61
+ return connectionCheckOutStartedEvent , true
52
62
case "connectioncheckoutfailedevent" :
53
63
return connectionCheckOutFailedEvent , true
54
64
case "connectioncheckedoutevent" :
@@ -61,6 +71,7 @@ func monitoringEventTypeFromString(eventStr string) (monitoringEventType, bool)
61
71
}
62
72
63
73
func monitoringEventTypeFromPoolEvent (evt * event.PoolEvent ) monitoringEventType {
74
+ // TODO GODRIVER-1827: add storePoolReady and storeConnectionCheckOutStarted events
64
75
switch evt .Type {
65
76
case event .PoolCreated :
66
77
return poolCreatedEvent
0 commit comments