[DRIVERS-1409] Add CommandStartedEvent to CommandSucceedEvent/CommandFailedEvent Created: 07/Oct/20  Updated: 07/Apr/23  Resolved: 27/Sep/22

Status: Closed
Project: Drivers
Component/s: Command Logging and Monitoring
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Divjot Arora (Inactive) Assignee: Unassigned
Resolution: Won't Do Votes: 0
Labels: leads-triage
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to DRIVERS-2575 Add collection name to all command lo... Backlog
related to GODRIVER-1761 CommandFinishedEvent have not db name... Closed
related to GODRIVER-2558 Add field Database with CommandFinish... Closed
related to DRIVERS-2452 Add databaseName property to command ... Implementing

 Description   

Original ticket:
GODRIVER-1761 requests that a databaseName property be added to CommandFailedEvent because storing the corresponding CommandStartedEvent and then retrieving it via the requestId field requires keeping a thread-safe map and the user says that this hurts their performance in highly concurrent applications.

Instead of duplicating fields like this across all three event types, would it be feasible to store a reference to the CommandStartedEvent in both CommandSucceedEvent and CommandFailedEvent? It would solve this specific issue and would also present a simpler API for users that only want to loop at a started/finished pair because they could register handlers for succeeded/failed and not have to register one for started.

Summary of discussion:
We will update the spec to state that drivers may store a CommandStartedEvent in a CommandSucceededEvent/CommandFailedEvent as an implementation detail if it makes sense for them.



 Comments   
Comment by Tom Selander [ 27/Sep/22 ]

After triage discussion, it was decided to create a new ticket for this work and make the work specific to databaseName only. Please track over in the next ticket: DRIVERS-2452

Comment by Divjot Arora (Inactive) [ 12/Oct/20 ]

kaitlin.mahar I'd be fine with adding databaseName to CommandFinishedEvent but I like Jeff's idea of embedding the full CommandStartedEvent in CommandSucceeded/Finished events as an implementation strategy for drivers that can efficiently do so. Maybe that could be called out as an acceptable alternative API in the spec?

Generated at Thu Feb 08 08:23:21 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.