-
1. Re: How to enable jmx in wildfly so that datasource pool usage can be monitored
rituraj Nov 5, 2014 12:24 AM (in response to yangju)cli can help in getting values related to pool usage
[domain@localhost:9990 statistics=pool] pwd
/host=hostname/server=server-name/subsystem=datasources/data-source=dsname/statistics=pool
[domain@localhost:9990 statistics=pool] :read-resource(include-runtime=true,recursive=true)
{
"outcome" => "success",
"result" => {
"ActiveCount" => "0",
"AvailableCount" => "20",
"AverageBlockingTime" => "1",
"AverageCreationTime" => "15",
"AverageGetTime" => "4",
"BlockingFailureCount" => "0",
"CreatedCount" => "72",
"DestroyedCount" => "72",
"IdleCount" => "0",
"InUseCount" => "0",
"MaxCreationTime" => "265",
"MaxGetTime" => "270",
"MaxUsedCount" => "1",
"MaxWaitCount" => "0",
"MaxWaitTime" => "5",
"TimedOut" => "72",
"TotalBlockingTime" => "55",
"TotalCreationTime" => "1147",
"TotalGetTime" => "1381",
"WaitCount" => "0"
}
}
-Rituraj
-
2. Re: How to enable jmx in wildfly so that datasource pool usage can be monitored
yangju Nov 10, 2014 10:53 AM (in response to rituraj)I know CLI can get datasource stats. But our monitor team has to use jmx connector to retrieve these stats and they don't want to use cli.
In eap 6, the datasource stats are showing in the jmx but in wildfly, this feature is removed for some reason.
-
3. Re: How to enable jmx in wildfly so that datasource pool usage can be monitored
jaysensharma Nov 12, 2014 5:52 AM (in response to yangju)Hi Richard,
I tested the same on WildFly 8 and 9 and i can see the Statistics of the DataSource form the MBean view as well using JConsole. Did you check the following MBeans attribute
jboss.as:subsystem=datasources,data-source=ExampleDS,statistics=pool
Attaching the screen shot from Wildfly 9 Alpha2 "JConsole_DataSource_Stats.png". Is this what you are looking for?
**NOTE:** Make sure to enable the DataSource statistics first , as now it is by default Disabled.
[standalone@localhost:9990 /] /subsystem=datasources/data-source=ExampleDS:write-attribute(name=statistics-enabled,value=true)
-
4. Re: How to enable jmx in wildfly so that datasource pool usage can be monitored
yangju Nov 12, 2014 10:48 AM (in response to jaysensharma)Thanks, Jay, for your help.
I tried to enable datasource stats in wildfly 8.1.0.Final but got error:
[standalone@localhost:9990 /] /subsystem=datasources/data-source=xxxxxx:write-attribute(name=statistics-enabled,value=true)
{
"outcome" => "failed",
"failure-description" => "JBAS014792: Unknown attribute statistics-enabled",
"rolled-back" => true
}
In my jconsole, I still don't see datasource stats. Can you try wildfly 8.1 instead of 9.0? 9.x is not released yet and we cannot use it in production.
Is there a way to enable the DS stats in standalone.xml (versus cli)?
-
5. Re: How to enable jmx in wildfly so that datasource pool usage can be monitored
yangju Nov 12, 2014 12:53 PM (in response to yangju)Hi, Jay, I think wildfly 8.1 has datasource pool stats enabled by default.
I was not seem this because I was not connect to the remote server correctly. Now I use the correct connection string:
service:jmx:http-remoting-jmx://xxx.xxx.xxx.xxx:9990 and provides the user and password and I now see the stats under the jboss.as category.
So I am marking your answer as correct.
If I do not user jconsole, instead, using other jmx tools, does the connection string is the same?
What if I want programmatically try to connect to the wildfly server and do jndi lookup, what the mbean server and port and protocol look like?
Thanks again for the help.
Richard