Say you're running JBoss EAP 6.x. Using CLI (CLI HowTo) would display following output for reading TestDS runtime values:
[standalone@localhost:9999 /] /subsystem=datasources/xa-data-source=TestDS/statistics=pool/:read-resource(include-runtime=true)
{
"outcome" => "success",
"result" => {
"ActiveCount" => "160",
"AvailableCount" => "195",
"AverageBlockingTime" => "19",
"AverageCreationTime" => "836",
"CreatedCount" => "160",
"DestroyedCount" => "0",
"InUseCount" => "5",
"MaxCreationTime" => "7332",
"MaxUsedCount" => "131",
"MaxWaitCount" => "0",
"MaxWaitTime" => "219",
"TimedOut" => "0",
"TotalBlockingTime" => "2998",
"TotalCreationTime" => "133795"
}
}
[standalone@localhost:9999 /]
{
"outcome" => "success",
"result" => {
"ActiveCount" => "160",
"AvailableCount" => "195",
"AverageBlockingTime" => "19",
"AverageCreationTime" => "836",
"CreatedCount" => "160",
"DestroyedCount" => "0",
"InUseCount" => "5",
"MaxCreationTime" => "7332",
"MaxUsedCount" => "131",
"MaxWaitCount" => "0",
"MaxWaitTime" => "219",
"TimedOut" => "0",
"TotalBlockingTime" => "2998",
"TotalCreationTime" => "133795"
}
}
[standalone@localhost:9999 /]
Now ActiveCount are somehow active connection within the TestDS connection pool. AvailableCount is the configured max-pool-size (e.g. in standalone.xml) minus InUseCount . For monitoring purposes you'll need a fixed value like max-pool-size instead of AvailableCount . So it's quite a good idea to monitor InUseCount in relation to max-pool-size.
Retrieve max-pool-size as follows:
Retrieve max-pool-size as follows:
[standalone@localhost:9999 /] /subsystem=datasources/xa-data-source=TestDS:read-attribute(name=max-pool-size,include-defaults=true)
{
"outcome" => "success",
"result" => 200
}
[standalone@localhost:9999 /]
{
"outcome" => "success",
"result" => 200
}
[standalone@localhost:9999 /]
Took me some time to examine. So feel free to share!