问题
In order to optimize the connection pool size, I thought it would make sense to graph query queue times. Is it possible to retrieve this metric from Mongoose?
回答1:
See here for node monitoring. You need cmap events that apparently aren't documented there, see Ruby docs for example but they should be published by the node driver also.
Track ConnectionCheckOutStarted and ConnectionCheckOutSucceeded and subtract the times to get the wait time.
来源:https://stackoverflow.com/questions/63652084/retrieve-mongoose-query-queue-time-metrics