Search code examples
node.jsmongodbmongooseconnection-poolingmongoose-plugins

Retrieve Mongoose Query Queue Time Metrics


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?


Solution

  • 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.