One MongoClient instance represents N connection pools, N is the number of MongoDB nodes except the hidden & arbiter nodes.
When a request needs a connection, suppose all the connection are in use, it will wait for N time unit before raise exception (suppose the wait queue size is not too long).
=== The above is my current understanding, please correct me if I'm anything wrong =====
Suppose we set the N to 400ms, and a request itself need 5ms database server response time + 15ms network transfer time. so the request may take 400 + 5 + 15 = 420 ms response time at most.
but in fact, all the 3 number are unknown. So if a customer says why I get 400+ms response time to DBA, DBA is hard to decide which part is wrong. DBA can only know the request is quicker than {slowms} since it is not recorded in mongo server slow query log. it is unknown that if the issue was caused by "network transfer time" or "connection wait time". This will make the troubleshooting hard.
so my question is, could we get the connection pool usage metrics in the driver? I think any one of the blow should be very useful.
1. How many connections is in use currently for every connection pool?
2. What many connections is got since the java process start and how about the average time?
but looks none of them are exposed now. do you have any suggestion for this?
Thanks