[GODRIVER-1212] Client/topology socket stats Created: 02/Aug/19  Updated: 27/Oct/23  Resolved: 09/Aug/19

Status: Closed
Project: Go Driver
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: New Feature Priority: Major - P3
Reporter: David Bartley Assignee: Emmanuel Eppinger (Inactive)
Resolution: Works as Designed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
related to GODRIVER-622 Implement Connection Monitoring and P... Closed

 Description   

mgo provides a mechanism to return various stats (https://godoc.org/labix.org/v2/mgo#Stats), particularly around number of in-use and idle sockets. I think you could get total sockets if you implemented a custom Dialer, but I don't think you could differentiate idle sockets.

mgo also tracks some stats on ops sent and docs received, but I think the existing CommandMonitor interface is flexible enough that'd it'd be better to just use that. ConnectionOption could be similarly extended to support a "WithServerPoolMonitor" or something like that.



 Comments   
Comment by Emmanuel Eppinger (Inactive) [ 08/Aug/19 ]

Hi David,

 

That was talked about as something that will probably be implemented in the future as part of our metrics epic. For now the best bet is to use the connection pool events if those give you enough information. 

 

Thanks and let us know if you have any other questions

Emmanuel

Comment by David Bartley [ 05/Aug/19 ]

Yeah, I think we could use ConnectionCheckedOutEvent and ConnectionCheckedInEvent to drive some counters. It still might be useful to have an implementation that just increments counters like mgo if it seems like something that would be generally useful to folks.

Comment by Jeffrey Yemin [ 05/Aug/19 ]

Hi bartle

In scope GODRIVER-622 we are implementing connection pool events, on top of which an application could easily build its own connection pool statistics.  

Please let us know if that will meet your needs.

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