Skip to content

Commit 331e1cd

Browse files
authored
GODRIVER-1844 add PoolReadyEvent and ConnectionCheckOutStartedEvent t… (#640)
1 parent 2e15326 commit 331e1cd

File tree

1 file changed

+23
-12
lines changed

1 file changed

+23
-12
lines changed

mongo/integration/unified/event.go

Lines changed: 23 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,25 @@ import (
1414

1515
type monitoringEventType string
1616

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
1721
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"
3036
)
3137

3238
func monitoringEventTypeFromString(eventStr string) (monitoringEventType, bool) {
@@ -39,6 +45,8 @@ func monitoringEventTypeFromString(eventStr string) (monitoringEventType, bool)
3945
return commandFailedEvent, true
4046
case "poolcreatedevent":
4147
return poolCreatedEvent, true
48+
case "poolreadyevent":
49+
return poolReadyEvent, true
4250
case "poolclearedevent":
4351
return poolClearedEvent, true
4452
case "poolclosedevent":
@@ -49,6 +57,8 @@ func monitoringEventTypeFromString(eventStr string) (monitoringEventType, bool)
4957
return connectionReadyEvent, true
5058
case "connectionclosedevent":
5159
return connectionClosedEvent, true
60+
case "connectioncheckoutstartedevent":
61+
return connectionCheckOutStartedEvent, true
5262
case "connectioncheckoutfailedevent":
5363
return connectionCheckOutFailedEvent, true
5464
case "connectioncheckedoutevent":
@@ -61,6 +71,7 @@ func monitoringEventTypeFromString(eventStr string) (monitoringEventType, bool)
6171
}
6272

6373
func monitoringEventTypeFromPoolEvent(evt *event.PoolEvent) monitoringEventType {
74+
// TODO GODRIVER-1827: add storePoolReady and storeConnectionCheckOutStarted events
6475
switch evt.Type {
6576
case event.PoolCreated:
6677
return poolCreatedEvent

0 commit comments

Comments
 (0)