The method db.Stats() exposes the DBStats struct that only has the number of connection open.
I would like to include:
db.numOpen - len(db.freeConn)len(db.connRequests)This would be great to export as a metric. We don't have any insight into what the right size of our connection pools should be, and it's even harder to debug delays when we think that queries are waiting for an open connection.
Please inspect tip: https://tip.golang.org/pkg/database/sql/#DBStats
Does this solve your need?
That's perfect. Thanks @kardianos!
yep, that looks good to me
is this going to be included in go 1.11? I don't see it here https://tip.golang.org/doc/go1.11
It will be in go1.11.
I didn't put it in the release notes.
Most helpful comment
Please inspect tip: https://tip.golang.org/pkg/database/sql/#DBStats
Does this solve your need?