Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(NODE-5169): Implement emergency logger #3610

Merged
merged 48 commits into from
Apr 14, 2023
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
a8d42ad
refactor(NODE-4813): WIP
W-A-James Mar 27, 2023
6b053d9
Merge branch 'main' into NODE-4813/Implement_severity_logging_methods
W-A-James Mar 29, 2023
e0b1db2
refactor(NODE-4813): start first draft of logger implementation
W-A-James Mar 29, 2023
d2ff692
style(NODE-4813): eslint
W-A-James Mar 29, 2023
a52b1ae
refactor(NODE-4813): Add changes to MongoLogger and ConnectionClosedE…
W-A-James Mar 29, 2023
16fee3f
test(NODE-4813): WIP - start adding tests
W-A-James Mar 31, 2023
b88003e
fix(NODE-4813): use HostAddress
W-A-James Apr 3, 2023
06a1bf0
fix(NODE-4813): Add Loggable interface
W-A-James Apr 3, 2023
3501a35
test(NODE-4813): Add connection events tests
W-A-James Apr 3, 2023
bf591b9
fix(NODE-4813): omit nullish fields
W-A-James Apr 3, 2023
36e2e32
test(NODE-4813): update tests
W-A-James Apr 3, 2023
80fbecd
refactor(NODE-4813): Update mongo client to accept @@mdb.internalLogC…
W-A-James Apr 4, 2023
da4f89c
test(NODE-4813): Add integration tests
W-A-James Apr 4, 2023
3c76aeb
test(NODE-4813): ensure that mongo logger works with MongoDBLogWritab…
W-A-James Apr 4, 2023
a39965f
style(NODE-4813): remove todo comment
W-A-James Apr 4, 2023
8bf2176
Merge branch 'main' into NODE-4813/Implement_severity_logging_methods
W-A-James Apr 4, 2023
97c8eba
refactor(NODE-5169): Change name getter on events to a property
W-A-James Apr 5, 2023
bcd88a8
Merge branch 'NODE-4813/Implement_severity_logging_methods' of github…
W-A-James Apr 5, 2023
d4b6300
refactor(NODE-5169): refactor to make use of existing constants
W-A-James Apr 5, 2023
ac7223c
test(NODE-5169): Updates tests for ConnectionClosedEvent logging
W-A-James Apr 5, 2023
f46ab9b
refactor(NODE-5169): Update logging of ConnectionClosedEvent to inclu…
W-A-James Apr 5, 2023
c7d8f8d
refactor(NODE-5619): continue refactor to use minimal writable interface
W-A-James Apr 5, 2023
993058f
refactor(NODE-5619): fix janky typecasting
W-A-James Apr 5, 2023
124702e
Merge branch 'main' into NODE-4813/Implement_severity_logging_methods
W-A-James Apr 6, 2023
0d91ccd
style(NODE-5169): eslint
W-A-James Apr 6, 2023
0fe2d2b
test(NODE-5169): Remove unneeded tests
W-A-James Apr 6, 2023
6ff5413
Merge branch 'NODE-4813/Implement_severity_logging_methods' of github…
W-A-James Apr 6, 2023
0a5b9cd
refactor(NODE-5169): Start implementing review changes
W-A-James Apr 7, 2023
bdde7cf
fix(NODE-5169): review comments
W-A-James Apr 10, 2023
f11f9d2
test(NODE-5169): add feature flag tests
W-A-James Apr 10, 2023
e70de2a
Merge branch 'main' into NODE-4813/Implement_severity_logging_methods
W-A-James Apr 10, 2023
3c742d6
refactor(NODE-5169): Change log signature
W-A-James Apr 10, 2023
4db07e6
fix(NODE-5169): fix check
W-A-James Apr 10, 2023
896a010
test(NODE-5169): test wip
W-A-James Apr 10, 2023
af2d8ed
refactor(NODE-5169): Refactor of resolveOptions and DEFAULT_LOG_TRANS…
W-A-James Apr 11, 2023
3e262c0
refactor(NODE-5169): Export appropriate constants
W-A-James Apr 11, 2023
18ed1e8
refactor(NODE-5169): Address review comments
W-A-James Apr 11, 2023
666221b
Merge branch 'main' into NODE-4813/Implement_severity_logging_methods
W-A-James Apr 12, 2023
b76ba6d
fix(NODE-5169): Remove createdStdioLogger from export
W-A-James Apr 12, 2023
4db4913
refactor(NODE-5169): Addres review comments
W-A-James Apr 12, 2023
be04325
test(NODE-5169): remove unneeded test file
W-A-James Apr 12, 2023
2299478
Merge branch 'main' into NODE-4813/Implement_severity_logging_methods
nbbeeken Apr 12, 2023
57a643c
fix(NODE-5169): Addres review comments and fix ConnectionCheckOutFail…
W-A-James Apr 13, 2023
c456ce9
fix(NODE-5169): update signature
W-A-James Apr 14, 2023
f258901
fix(NODE-5169): convert to MongoError
W-A-James Apr 14, 2023
442557b
style(NODE-5169): eslint
W-A-James Apr 14, 2023
dd66ea3
refactor(NODE-5169): update function signature
W-A-James Apr 14, 2023
369216d
Merge branch 'main' into NODE-4813/Implement_severity_logging_methods
W-A-James Apr 14, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 12 additions & 0 deletions src/cmap/command_monitoring_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,10 @@ export class CommandStartedEvent {
get hasServiceId(): boolean {
return !!this.serviceId;
}

get name(): string {
return 'CommandStarted';
}
W-A-James marked this conversation as resolved.
Show resolved Hide resolved
}

/**
Expand Down Expand Up @@ -98,6 +102,10 @@ export class CommandSucceededEvent {
get hasServiceId(): boolean {
return !!this.serviceId;
}

get name(): string {
return 'CommandSucceeded';
}
}

/**
Expand Down Expand Up @@ -147,6 +155,10 @@ export class CommandFailedEvent {
get hasServiceId(): boolean {
return !!this.serviceId;
}

get name(): string {
return 'CommandFailed';
}
}

/**
Expand Down
38 changes: 38 additions & 0 deletions src/cmap/connection_pool_events.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,18 @@ export class ConnectionPoolMonitoringEvent {
export class ConnectionPoolCreatedEvent extends ConnectionPoolMonitoringEvent {
/** The options used to create this connection pool */
options?: ConnectionPoolOptions;
/** The size of the ConnectionPool's waitQueue */
waitQueueSize: number;
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved

/** @internal */
constructor(pool: ConnectionPool) {
super(pool);
this.options = pool.options;
this.waitQueueSize = pool.waitQueueSize;
}

get name(): string {
return 'ConnectionPoolCreated';
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
}
}

Expand All @@ -47,6 +54,9 @@ export class ConnectionPoolReadyEvent extends ConnectionPoolMonitoringEvent {
constructor(pool: ConnectionPool) {
super(pool);
}
get name(): string {
return 'ConnectionPoolReady';
}
}

/**
Expand All @@ -59,6 +69,9 @@ export class ConnectionPoolClosedEvent extends ConnectionPoolMonitoringEvent {
constructor(pool: ConnectionPool) {
super(pool);
}
get name(): string {
return 'ConnectionPoolClosed';
}
}

/**
Expand All @@ -75,6 +88,9 @@ export class ConnectionCreatedEvent extends ConnectionPoolMonitoringEvent {
super(pool);
this.connectionId = connection.id;
}
get name(): string {
return 'ConnectionCreated';
}
}

/**
Expand All @@ -91,6 +107,9 @@ export class ConnectionReadyEvent extends ConnectionPoolMonitoringEvent {
super(pool);
this.connectionId = connection.id;
}
get name(): string {
return 'ConnectionReady';
}
}

/**
Expand All @@ -116,6 +135,9 @@ export class ConnectionClosedEvent extends ConnectionPoolMonitoringEvent {
this.reason = reason || 'unknown';
nbbeeken marked this conversation as resolved.
Show resolved Hide resolved
this.serviceId = connection.serviceId;
}
get name(): string {
return 'ConnectionClosed';
}
}

/**
Expand All @@ -128,6 +150,9 @@ export class ConnectionCheckOutStartedEvent extends ConnectionPoolMonitoringEven
constructor(pool: ConnectionPool) {
super(pool);
}
get name(): string {
return 'ConnectionCheckOutStarted';
}
}

/**
Expand All @@ -144,6 +169,9 @@ export class ConnectionCheckOutFailedEvent extends ConnectionPoolMonitoringEvent
super(pool);
this.reason = reason;
}
get name(): string {
return 'ConnectionCheckOutFailed';
}
}

/**
Expand All @@ -160,6 +188,9 @@ export class ConnectionCheckedOutEvent extends ConnectionPoolMonitoringEvent {
super(pool);
this.connectionId = connection.id;
}
get name(): string {
return 'ConnectionCheckedOut';
}
}

/**
Expand All @@ -176,6 +207,9 @@ export class ConnectionCheckedInEvent extends ConnectionPoolMonitoringEvent {
super(pool);
this.connectionId = connection.id;
}
get name(): string {
return 'ConnectionCheckedIn';
}
}

/**
Expand All @@ -198,4 +232,8 @@ export class ConnectionPoolClearedEvent extends ConnectionPoolMonitoringEvent {
this.serviceId = options.serviceId;
this.interruptInUseConnections = options.interruptInUseConnections;
}

get name(): string {
return 'ConnectionPoolCleared';
}
}