use of org.glassfish.external.probe.provider.annotations.ProbeListener in project Payara by payara.
the class ConnectorConnPoolStatsProvider method decrementNumConnFreeEvent.
/**
* Decrement numconnfree event
* @param poolName
*/
@ProbeListener(JCA_PROBE_LISTENER + "decrementNumConnFreeEvent")
public void decrementNumConnFreeEvent(@ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName) {
// handle the num conn free decrement event
PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
if (this.poolInfo.equals(poolInfo)) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Decrement Num Connections Free event received - poolName = " + poolName);
}
// Decrement counter
synchronized (numConnFree) {
long numConnFreeSafe = (numConnFree.getCurrent() - 1 >= 0) ? numConnFree.getCurrent() - 1 : 0;
numConnFree.setCurrent(numConnFreeSafe);
}
}
}
use of org.glassfish.external.probe.provider.annotations.ProbeListener in project Payara by payara.
the class ConnectorConnPoolStatsProvider method connectionRequestServedEvent.
/**
* Event that a connection request is served in timeTakenInMillis.
*
* @param poolName
* @param timeTakenInMillis
*/
@ProbeListener(JCA_PROBE_LISTENER + "connectionRequestServedEvent")
public void connectionRequestServedEvent(@ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName, @ProbeParam("timeTakenInMillis") long timeTakenInMillis) {
PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
if (this.poolInfo.equals(poolInfo)) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Connection request served event received - " + "poolName = " + poolName);
}
connRequestWaitTime.setCurrent(timeTakenInMillis);
totalConnRequestWaitTime.increment(timeTakenInMillis);
}
}
use of org.glassfish.external.probe.provider.annotations.ProbeListener in project Payara by payara.
the class JdbcConnPoolStatsProvider method decrementNumConnFreeEvent.
/**
* Decrement numconnfree event
* @param poolName
* @param steadyPoolSize
*/
@ProbeListener(JDBC_PROBE_LISTENER + "decrementNumConnFreeEvent")
public void decrementNumConnFreeEvent(@ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName) {
// handle the num conn free decrement event
PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
if (this.poolInfo.equals(poolInfo)) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Decrement Num Connections Free event received - poolName = " + poolName);
}
// Decrement counter
synchronized (numConnFree) {
long numConnFreeSafe = (numConnFree.getCurrent() - 1 >= 0) ? numConnFree.getCurrent() - 1 : 0;
numConnFree.setCurrent(numConnFreeSafe);
}
}
}
use of org.glassfish.external.probe.provider.annotations.ProbeListener in project Payara by payara.
the class JdbcConnPoolStatsProvider method connectionsFreedEvent.
/**
* Connections freed event
* @param poolName
* @param count number of connections freed to the pool
*/
@ProbeListener(JDBC_PROBE_LISTENER + "connectionsFreedEvent")
public void connectionsFreedEvent(@ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName, @ProbeParam("count") int count) {
// handle the connections freed event
PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName);
if (this.poolInfo.equals(poolInfo)) {
if (logger.isLoggable(Level.FINEST)) {
logger.finest("Connections Freed event received - poolName = " + poolName);
logger.finest("numConnUsed =" + numConnUsed.getCurrent() + " numConnFree=" + numConnFree.getCurrent() + " Number of connections freed =" + count);
}
// set numConnFree to the count value
synchronized (numConnFree) {
numConnFree.setCurrent(count);
}
}
}
use of org.glassfish.external.probe.provider.annotations.ProbeListener in project Payara by payara.
the class WebServiceStatsProvider method riUndeploy.
// sun-jaxws.xml undeployment
@ProbeListener("glassfish:webservices:deployment-ri:undeploy")
public synchronized void riUndeploy(@ProbeParam("adapter") ServletAdapter adapter) {
ServletContext ctxt = adapter.getServletContext();
String name = ctxt.getContextPath() + adapter.getValidPath();
DeployedEndpointData data = endpoints.remove(name);
String contextPath = adapter.getServletContext().getContextPath();
List<DeployedEndpointData> ri = riEndpoints.get(contextPath);
if (ri != null) {
ri.remove(data);
if (ri.isEmpty()) {
riEndpoints.remove(contextPath);
}
}
}
Aggregations