@Deprecated
public class ConnectionPoolStat
extends java.lang.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(javax.management.MBeanServerConnection mBeanConnection)
Deprecated.
Use the given MBean server connection to access statistics for connection pools.
|
| Modifier and Type | Method and Description |
|---|---|
java.lang.String |
getStats()
Deprecated.
Gets the statistics for all Mongo connection pools registered with the MBean server used
by this instance.
|
static void |
main(java.lang.String[] args)
Deprecated.
Command line interface for displaying connection pool stats.
|
public ConnectionPoolStat(javax.management.MBeanServerConnection mBeanConnection)
mBeanConnection - the MBean server to connect topublic ConnectionPoolStat()
ManagementFactory.getPlatformMBeanServer()public java.lang.String getStats()
throws javax.management.JMException,
java.io.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 },
]
}
]
}javax.management.JMException - for any JMX-related exceptionsjava.io.IOException - for any I/O exceptionspublic static void main(java.lang.String[] args)
throws java.lang.Exception
args - program argumentsjava.lang.Exception - JMX-related exceptionsprintUsage()