Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-6991

Add pool stats for ShardedConnection

    • Fully Compatible

      Currently, the connPoolStats will only get stats from the extern pool object. This is linked to the pool ScopedDBConnection uses and it does not include the shardConnectionPool.

      Add a new command called "shardConnPoolStats" which will show information on the per thread (incoming connection) connection status. Sample output for a sharded cluster with a single replica set below:

      mongos> db.runCommand( { 'shardConnPoolStats': 1 } )
      {
      	"hosts" : {
      		"test-rs0/dan-tm2:31100,dan-tm2:31101,dan-tm2:31102::0" : {
      			"available" : 0,
      			"created" : 2
      		}
      	},
      	"replicaSets" : {
      		"test-rs0" : {
      			"hosts" : [
      				{
      					"addr" : "dan-tm2:31100",
      					"ok" : true,
      					"ismaster" : true,
      					"hidden" : false,
      					"secondary" : false,
      					"pingTimeMillis" : 0
      				},
      				{
      					"addr" : "dan-tm2:31101",
      					"ok" : true,
      					"ismaster" : false,
      					"hidden" : false,
      					"secondary" : true,
      					"pingTimeMillis" : 0
      				},
      				{
      					"addr" : "dan-tm2:31102",
      					"ok" : true,
      					"ismaster" : false,
      					"hidden" : false,
      					"secondary" : true,
      					"pingTimeMillis" : 0
      				}
      			],
      			"master" : 0,
      			"nextSlave" : 0
      		}
      	},
      	"createdByType" : {
      		"set" : 2
      	},
      	"totalAvailable" : 0,
      	"totalCreated" : 2,
      	"threads" : [
      		{
      			"hosts" : [
      				{
      					"host" : "test-rs0/dan-tm2:31100,dan-tm2:31101,dan-tm2:31102",
      					"created" : NumberLong(1),
      					"avail" : true
      				}
      			],
      			"seenNS" : [
      				"test.data"
      			]
      		},
      		{
      			"hosts" : [
      				{
      					"host" : "test-rs0/dan-tm2:31100,dan-tm2:31101,dan-tm2:31102",
      					"created" : NumberLong(1),
      					"avail" : true
      				}
      			],
      			"seenNS" : [
      				"test.data"
      			]
      		}
      	],
      	"ok" : 1
      }
      

            Assignee:
            greg_10gen Greg Studer
            Reporter:
            randolph@mongodb.com Randolph Tan
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: