Hey guys, I'm getting the current number of available connections in a given connection pool like this (and it seems to work): ODatabaseDocumentPool.global().getPools().get(myPoolName).getMaxResources();
Where *myPoolName* is a string *<dbUser>@<dbMode>* (i.e. "admin@plocal" etc.) Take into account that you can have multiple connection pools. The name for *getAvailableConnections() *is indeed a bit unfortunate and ambiguous. Mateusz On Tuesday, September 2, 2014 8:04:56 PM UTC+9, Epl wrote: > > Hi > > I have not tried much by myself but you could give a try using JMX plugin, > https://github.com/orientechnologies/orientdb/wiki/JMX-Plugin. > Before use, you need to enable it. Once it is enabled you can use Jconsole > or visualvm to take a look at exposed managed beans. > > As profiler is not available in community server I doubt you will be able > to use Profiler managed bean from your Jconsole but there is another mbean > called com.orientechnologies.orient.server.managed.OrientServer, which > expose com.orientechnologies.orient.server.OClientConnection class. and > that can give you connection usage details. > > I think you can also write your mbean or new plugin to get desired > details. > https://github.com/orientechnologies/orientdb/wiki/DB-Server#handlers > > May be someone from OrientDB team can guide us more or validate above > understanding. > > On Monday, September 1, 2014 9:56:42 PM UTC+1, Dexter Pratt wrote: >> >> I'd like to re-open Jing's underlying question: How can we monitor the >> number of open connections? More generally, what other tools can help us >> debug connection problems? We may have a connection leak somewhere in our >> application, but its going to be hard to find without instrumentation. >> >> On Friday, August 29, 2014 12:08:14 PM UTC-7, Jing Chen wrote: >>> >>> Hi >>> >>> We are using OrientDB 1.7.8. >>> >>> In my code, I created a connection pool using ODatabaseDocumentPool. I >>> was trying to monitor the usage of my connection pool. According to the >>> documentation, it seems that I can use this function >>> >>> ODatabaseDocumentPool >>> <http://www.orientechnologies.com/javadoc/latest/com/orientechnologies/orient/core/db/document/ODatabaseDocumentPool.html> >>> .getAvailableConnections(String,String) >>> >>> to get the current usage, but it always returns the maximum pool size. >>> Looking at the implementation of this function in ODatabasePoolBase. It is >>> something like this >>> >>> public int getAvailableConnections(final String name, final String >>> userName) { >>> setup(); >>> return dbPool.getMaxConnections(name, userName); >>> } >>> >>> Is this a bug or should I use another function to get the available >>> connections? >>> >>> Thanks, >>> Jing >>> >> -- --- You received this message because you are subscribed to the Google Groups "OrientDB" group. To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.