Package org.glassfish.jdbc.pool.monitor
Class JdbcConnPoolStatsProvider
- java.lang.Object
-
- org.glassfish.jdbc.pool.monitor.JdbcConnPoolStatsProvider
-
@AMXMetadata(type="jdbc-connection-pool-mon", group="monitoring") @ManagedObject @Description("JDBC Statistics") public class JdbcConnPoolStatsProvider extends Object
StatsProvider object for Jdbc pool monitoring. Implements various events related to jdbc pool monitoring and provides objects to the calling modules that retrieve monitoring information.- Author:
- Shalini M
-
-
Constructor Summary
Constructors Constructor Description JdbcConnPoolStatsProvider(PoolInfo poolInfo, Logger logger)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
connectionAcquiredEvent(String poolName, String appName, String moduleName)
When a connection is acquired increment countervoid
connectionCreatedEvent(String poolName, String appName, String moduleName)
When a connection is created increment countervoid
connectionDestroyedEvent(String poolName, String appName, String moduleName)
When connection destroyed event is got increment numConnDestroyed.void
connectionMatchedEvent(String poolName, String appName, String moduleName)
When connection under test matches the current request , increment numConnSuccessfullyMatched.void
connectionNotMatchedEvent(String poolName, String appName, String moduleName)
When a connection under test does not match the current request, increment numConnNotSuccessfullyMatched.void
connectionReleasedEvent(String poolName, String appName, String moduleName)
When a connection is released increment countervoid
connectionRequestDequeuedEvent(String poolName, String appName, String moduleName)
When an object is removed from the wait queue, decrement the waitQueueLength.void
connectionRequestQueuedEvent(String poolName, String appName, String moduleName)
When an object is added to wait queue, increment the waitQueueLength.void
connectionRequestServedEvent(String poolName, String appName, String moduleName, long timeTakenInMillis)
Event that a connection request is served in timeTakenInMillis.void
connectionsFreedEvent(String poolName, String appName, String moduleName, int count)
Connections freed eventvoid
connectionTimedOutEvent(String poolName, String appName, String moduleName)
Whenever connection timed-out event occurs, increment numConnTimedOutvoid
connectionUsedEvent(String poolName, String appName, String moduleName)
Connection used eventvoid
connectionValidationFailedEvent(String poolName, String appName, String moduleName, int increment)
Whenever connection leak happens, increment numConnFailedValidationvoid
decrementConnectionUsedEvent(String poolName, String appName, String moduleName)
Decrement numConnUsed eventvoid
decrementNumConnFreeEvent(String poolName, String appName, String moduleName)
Decrement numconnfree eventorg.glassfish.external.statistics.CountStatistic
getAverageConnWaitTime()
org.glassfish.external.statistics.RangeStatistic
getConnRequestWaitTime()
org.glassfish.external.statistics.CountStatistic
getNumConnAcquired()
org.glassfish.external.statistics.CountStatistic
getNumConnCreated()
org.glassfish.external.statistics.CountStatistic
getNumConnDestroyed()
org.glassfish.external.statistics.CountStatistic
getNumConnFailedValidation()
org.glassfish.external.statistics.RangeStatistic
getNumConnFree()
org.glassfish.external.statistics.CountStatistic
getNumConnNotSuccessfullyMatched()
org.glassfish.external.statistics.CountStatistic
getNumConnReleased()
org.glassfish.external.statistics.CountStatistic
getNumConnSuccessfullyMatched()
org.glassfish.external.statistics.CountStatistic
getNumConnTimedOut()
org.glassfish.external.statistics.RangeStatistic
getNumConnUsed()
org.glassfish.external.statistics.CountStatistic
getNumPotentialConnLeakCount()
When a connection leak is observed, the monitoring statistics are displayed to the server.log.PoolInfo
getPoolInfo()
PoolLifeCycleListenerRegistry
getPoolRegistry()
org.glassfish.external.statistics.CountStatistic
getWaitQueueLength()
void
incrementNumConnFreeEvent(String poolName, String appName, String moduleName, boolean beingDestroyed, int steadyPoolSize)
Increment numconnfree eventvoid
potentialConnLeakEvent(String poolName, String appName, String moduleName)
Whenever connection leak happens, increment numPotentialConnLeakvoid
reset()
Reset pool statistics.void
setPoolRegistry(PoolLifeCycleListenerRegistry poolRegistry)
-
-
-
Method Detail
-
potentialConnLeakEvent
public void potentialConnLeakEvent(String poolName, String appName, String moduleName)
Whenever connection leak happens, increment numPotentialConnLeak- Parameters:
pool
- JdbcConnectionPool that got a connLeakEvent
-
connectionTimedOutEvent
public void connectionTimedOutEvent(String poolName, String appName, String moduleName)
Whenever connection timed-out event occurs, increment numConnTimedOut- Parameters:
pool
- JdbcConnectionPool that got a connTimedOutEvent
-
decrementNumConnFreeEvent
public void decrementNumConnFreeEvent(String poolName, String appName, String moduleName)
Decrement numconnfree event- Parameters:
poolName
-steadyPoolSize
-
-
incrementNumConnFreeEvent
public void incrementNumConnFreeEvent(String poolName, String appName, String moduleName, boolean beingDestroyed, int steadyPoolSize)
Increment numconnfree event- Parameters:
poolName
-steadyPoolSize
-
-
decrementConnectionUsedEvent
public void decrementConnectionUsedEvent(String poolName, String appName, String moduleName)
Decrement numConnUsed event- Parameters:
poolName
-beingDestroyed
- if the connection is destroyed due to errorsteadyPoolSize
-
-
connectionsFreedEvent
public void connectionsFreedEvent(String poolName, String appName, String moduleName, int count)
Connections freed event- Parameters:
poolName
-count
- number of connections freed to the pool
-
connectionUsedEvent
public void connectionUsedEvent(String poolName, String appName, String moduleName)
Connection used event- Parameters:
poolName
-
-
connectionValidationFailedEvent
public void connectionValidationFailedEvent(String poolName, String appName, String moduleName, int increment)
Whenever connection leak happens, increment numConnFailedValidation- Parameters:
pool
- JdbcConnectionPool that got a failed validation event
-
connectionRequestServedEvent
public void connectionRequestServedEvent(String poolName, String appName, String moduleName, long timeTakenInMillis)
Event that a connection request is served in timeTakenInMillis.- Parameters:
poolName
-timeTakenInMillis
-
-
connectionDestroyedEvent
public void connectionDestroyedEvent(String poolName, String appName, String moduleName)
When connection destroyed event is got increment numConnDestroyed.
-
connectionAcquiredEvent
public void connectionAcquiredEvent(String poolName, String appName, String moduleName)
When a connection is acquired increment counter
-
connectionReleasedEvent
public void connectionReleasedEvent(String poolName, String appName, String moduleName)
When a connection is released increment counter
-
connectionCreatedEvent
public void connectionCreatedEvent(String poolName, String appName, String moduleName)
When a connection is created increment counter
-
reset
public void reset()
Reset pool statistics. When annotated with @Reset, this method is invoked whenever monitoring is turned to HIGH from OFF, thereby setting the statistics to appropriate values.
-
connectionMatchedEvent
public void connectionMatchedEvent(String poolName, String appName, String moduleName)
When connection under test matches the current request , increment numConnSuccessfullyMatched.
-
connectionNotMatchedEvent
public void connectionNotMatchedEvent(String poolName, String appName, String moduleName)
When a connection under test does not match the current request, increment numConnNotSuccessfullyMatched.
-
connectionRequestQueuedEvent
public void connectionRequestQueuedEvent(String poolName, String appName, String moduleName)
When an object is added to wait queue, increment the waitQueueLength.
-
connectionRequestDequeuedEvent
public void connectionRequestDequeuedEvent(String poolName, String appName, String moduleName)
When an object is removed from the wait queue, decrement the waitQueueLength.
-
getPoolInfo
public PoolInfo getPoolInfo()
-
setPoolRegistry
public void setPoolRegistry(PoolLifeCycleListenerRegistry poolRegistry)
-
getPoolRegistry
public PoolLifeCycleListenerRegistry getPoolRegistry()
-
getNumPotentialConnLeakCount
@ManagedAttribute(id="numpotentialconnleak") public org.glassfish.external.statistics.CountStatistic getNumPotentialConnLeakCount()
When a connection leak is observed, the monitoring statistics are displayed to the server.log. This method helps in segregating the statistics based on LOW/HIGH monitoring levels and displaying them.- Parameters:
poolName
-stackTrace
-
-
getNumConnFailedValidation
@ManagedAttribute(id="numconnfailedvalidation") public org.glassfish.external.statistics.CountStatistic getNumConnFailedValidation()
-
getNumConnTimedOut
@ManagedAttribute(id="numconntimedout") public org.glassfish.external.statistics.CountStatistic getNumConnTimedOut()
-
getNumConnUsed
@ManagedAttribute(id="numconnused") public org.glassfish.external.statistics.RangeStatistic getNumConnUsed()
-
getNumConnFree
@ManagedAttribute(id="numconnfree") public org.glassfish.external.statistics.RangeStatistic getNumConnFree()
-
getConnRequestWaitTime
@ManagedAttribute(id="connrequestwaittime") public org.glassfish.external.statistics.RangeStatistic getConnRequestWaitTime()
-
getNumConnDestroyed
@ManagedAttribute(id="numconndestroyed") public org.glassfish.external.statistics.CountStatistic getNumConnDestroyed()
-
getNumConnAcquired
@ManagedAttribute(id="numconnacquired") public org.glassfish.external.statistics.CountStatistic getNumConnAcquired()
-
getNumConnCreated
@ManagedAttribute(id="numconncreated") public org.glassfish.external.statistics.CountStatistic getNumConnCreated()
-
getNumConnReleased
@ManagedAttribute(id="numconnreleased") public org.glassfish.external.statistics.CountStatistic getNumConnReleased()
-
getNumConnSuccessfullyMatched
@ManagedAttribute(id="numconnsuccessfullymatched") public org.glassfish.external.statistics.CountStatistic getNumConnSuccessfullyMatched()
-
getNumConnNotSuccessfullyMatched
@ManagedAttribute(id="numconnnotsuccessfullymatched") public org.glassfish.external.statistics.CountStatistic getNumConnNotSuccessfullyMatched()
-
getAverageConnWaitTime
@ManagedAttribute(id="averageconnwaittime") public org.glassfish.external.statistics.CountStatistic getAverageConnWaitTime()
-
getWaitQueueLength
@ManagedAttribute(id="waitqueuelength") public org.glassfish.external.statistics.CountStatistic getWaitQueueLength()
-
-