use of com.sun.enterprise.resource.pool.PoolStatus in project Payara by payara.
the class ConnectorConnPoolStatsProvider method 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.
*/
@Reset
public void reset() {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Reset event received - poolName = " + poolInfo);
}
PoolStatus status = ConnectorRuntime.getRuntime().getPoolManager().getPoolStatus(poolInfo);
numConnUsed.setCurrent(status.getNumConnUsed());
numConnFree.setCurrent(status.getNumConnFree());
numConnCreated.reset();
numConnDestroyed.reset();
numConnFailedValidation.reset();
numConnTimedOut.reset();
numConnAcquired.reset();
numConnReleased.reset();
connRequestWaitTime.reset();
numConnSuccessfullyMatched.reset();
numConnNotSuccessfullyMatched.reset();
numPotentialConnLeak.reset();
averageConnWaitTime.reset();
totalConnRequestWaitTime.reset();
waitQueueLength.reset();
}
use of com.sun.enterprise.resource.pool.PoolStatus in project Payara by payara.
the class JdbcConnPoolStatsProvider method 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.
*/
@Reset
public void reset() {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Reset event received - poolInfo = " + poolInfo);
}
PoolStatus status = ConnectorRuntime.getRuntime().getPoolManager().getPoolStatus(poolInfo);
numConnUsed.setCurrent(status.getNumConnUsed());
numConnFree.setCurrent(status.getNumConnFree());
numConnCreated.reset();
numConnDestroyed.reset();
numConnFailedValidation.reset();
numConnTimedOut.reset();
numConnAcquired.reset();
numConnReleased.reset();
connRequestWaitTime.reset();
numConnSuccessfullyMatched.reset();
numConnNotSuccessfullyMatched.reset();
numPotentialConnLeak.reset();
averageConnWaitTime.reset();
totalConnRequestWaitTime.reset();
waitQueueLength.reset();
}
use of com.sun.enterprise.resource.pool.PoolStatus in project Payara by payara.
the class ConnectionPoolHealthCheck method evaluatePoolUsage.
private void evaluatePoolUsage(HealthCheckResult result, PoolInfo poolInfo) {
PoolStatus poolStatus = poolManager.getPoolStatus(poolInfo);
if (poolStatus != null) {
long usedConnection = poolStatus.getNumConnUsed();
long freeConnection = poolStatus.getNumConnFree();
long totalConnection = usedConnection + freeConnection;
if (totalConnection > 0) {
double usedPercentage = ((double) usedConnection / totalConnection) * 100;
result.add(new HealthCheckResultEntry(decideOnStatusWithRatio(usedPercentage), poolInfo.getName() + " Usage (%): " + new DecimalFormat("#.00").format(usedPercentage)));
}
}
}
Aggregations