@Deprecated public class ConnectionPoolStat extends Object
This class also exposes a command line interface modeled after mongostat. For usage, run:
java -cp mongo.jar com.mongodb.util.tools.ConnectionPoolStat --help}
| Constructor and Description |
|---|
ConnectionPoolStat()
Deprecated.
Use the platform MBean server.
|
ConnectionPoolStat(MBeanServerConnection mBeanConnection)
Deprecated.
Use the given MBean server connection to access statistics for connection pools.
|
| Modifier and Type | Method and Description |
|---|---|
String |
getStats()
Deprecated.
Gets the statistics for all Mongo connection pools registered with the MBean server used
by this instance.
|
static void |
main(String[] args)
Deprecated.
Command line interface for displaying connection pool stats.
|
public ConnectionPoolStat(MBeanServerConnection mBeanConnection)
mBeanConnection - the MBean server to connect topublic ConnectionPoolStat()
public String getStats() throws JMException, IOException
{ pools : [
{ objectName: 'com.mongodb:type=ConnectionPool,host=localhost/127.0.0.1,port=27018,instance=1',
host: 'localhost', port: 27018, maxSize: 10, total: 10, inUse: 3,
inUseConnections: [
{ namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-2-thread-19', durationMS: 843, localPort: 64062 },
{ namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-2-thread-1', durationMS: 4331, localPort: 64095 },
{ namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-2-thread-16', durationMS: 4343, localPort: 64087 }
]
},
{ objectName: 'com.mongodb:type=ConnectionPool,host=localhost/127.0.0.1,port=27017,instance=1',
host: 'localhost', port: 27017, maxSize: 10, total: 10, inUse: 2,
inUseConnections: [
{ namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-2-thread-5', durationMS: 920, localPort: 64093 },
{ namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-2-thread-11', durationMS: 1468, localPort: 64068 },
]
}
]
}JMException - for any JMX-related exceptionsIOException - for any I/O exceptionspublic static void main(String[] args) throws Exception
args - program argumentsException - JMX-related exceptionsprintUsage()