[JAVA-761] ConnectionPoolStat not working Created: 19/Feb/13  Updated: 12/Jul/13  Resolved: 12/Jul/13

Status: Closed
Project: Java Driver
Component/s: Monitoring
Affects Version/s: 2.10.1
Fix Version/s: None

Type: Bug Priority: Minor - P4
Reporter: Herve Eichwald Assignee: Unassigned
Resolution: Cannot Reproduce Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: Text File MongoFindContentionTest.java    

 Description   

Hi,

I experience this issue when trying to use ConnectionPoolStat:
Caused by: java.lang.RuntimeException: unknown attribute: Host

I have a webapp running on tomcat 7.0.28 and connecting to Mongo fine.
I tried conencting with another JVM using JMX and also within the same JVM (webapp) and in both cases , i got the RuntimeException above.

Regards



 Comments   
Comment by Jeffrey Yemin [ 12/Jul/13 ]

Closing this, but please re-open if you have more information.

Comment by Jeffrey Yemin [ 25/Jun/13 ]

Have you been able to look at this again?

Comment by Herve Eichwald [ 11/Mar/13 ]

Hi,

sorry Jeff, I did not have time to look further yet.

Comment by Jeffrey Yemin [ 09/Mar/13 ]

Hi Herve,

Any more information?

Comment by Herve Eichwald [ 20/Feb/13 ]

Thanks,

I removed this from my Tomcat config, <Listener className="org.apache.catalina.mbeans.JmxRemoteLifecycleListener" rmiRegistryPortPlatform="9091" rmiServerPortPlatform="9092" useLocalPorts="true" />

and run it from the same JVM and now it is working. I will try to see more tomorrow.

Comment by Jeffrey Yemin [ 19/Feb/13 ]

Test program attached. I ran it with 2.10.1 driver

Comment by Jeffrey Yemin [ 19/Feb/13 ]

I tried to reproduce this with my own test program, and could not. It prints outs something like:

{ pools : [
   { objectName: 'com.mongodb:type=ConnectionPool,host=localhost/127.0.0.1,port=27017,instance=1', 
     host: 'localhost', port: 27017, maxSize: 10, total: 10, inUse: 10, 
     inUseConnections: [
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-6', durationMS: 10, localPort: 54601 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-17', durationMS: 31, localPort: 54603 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-19', durationMS: 183, localPort: 54599 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-15', durationMS: 193, localPort: 54608 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-20', durationMS: 355, localPort: 54602 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-16', durationMS: 362, localPort: 54606 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-2', durationMS: 370, localPort: 54607 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-8', durationMS: 372, localPort: 54600 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-12', durationMS: 374, localPort: 54605 }, 
      { namespace: 'FindContention.test', opCode: 'OP_QUERY', query: { }, numDocuments: 1, threadName: 'pool-1-thread-9', durationMS: 374, localPort: 54604 }
     ]
   }
  ]
}

I'll attach my code in a bit. Can you try running it and see if it works for you? Then maybe we can work out what's different.

Generated at Thu Feb 08 08:53:00 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.