Search in sources :

Example 1 with ProbeListener

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);
        }
    }
}
Also used : PoolInfo(org.glassfish.resourcebase.resources.api.PoolInfo) ProbeListener(org.glassfish.external.probe.provider.annotations.ProbeListener)

Example 2 with ProbeListener

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);
    }
}
Also used : PoolInfo(org.glassfish.resourcebase.resources.api.PoolInfo) ProbeListener(org.glassfish.external.probe.provider.annotations.ProbeListener)

Example 3 with ProbeListener

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);
        }
    }
}
Also used : PoolInfo(org.glassfish.resourcebase.resources.api.PoolInfo) ProbeListener(org.glassfish.external.probe.provider.annotations.ProbeListener)

Example 4 with ProbeListener

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);
        }
    }
}
Also used : PoolInfo(org.glassfish.resourcebase.resources.api.PoolInfo) ProbeListener(org.glassfish.external.probe.provider.annotations.ProbeListener)

Example 5 with ProbeListener

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);
        }
    }
}
Also used : DeployedEndpointData(org.glassfish.webservices.deployment.DeployedEndpointData) ServletContext(javax.servlet.ServletContext) ProbeListener(org.glassfish.external.probe.provider.annotations.ProbeListener)

Aggregations

ProbeListener (org.glassfish.external.probe.provider.annotations.ProbeListener)10 PoolInfo (org.glassfish.resourcebase.resources.api.PoolInfo)7 DeployedEndpointData (org.glassfish.webservices.deployment.DeployedEndpointData)2 SQLTrace (com.sun.gjc.util.SQLTrace)1 SlowSqlTrace (fish.payara.jdbc.stats.SlowSqlTrace)1 Method (java.lang.reflect.Method)1 LinkedList (java.util.LinkedList)1 ServletContext (javax.servlet.ServletContext)1 FlashlightProbe (org.glassfish.flashlight.provider.FlashlightProbe)1