/** When an object is added to wait queue, increment the waitQueueLength. */ @ProbeListener(JCA_PROBE_LISTENER + "connectionRequestQueuedEvent") public void connectionRequestQueuedEvent( @ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName) { PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName); if (this.poolInfo.equals(poolInfo)) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Wait Queue length modified event received - " + "poolName = " + poolName); } waitQueueLength.increment(); } }
/** * When a connection under test does not match the current request, increment * numConnNotSuccessfullyMatched. */ @ProbeListener(JCA_PROBE_LISTENER + "connectionNotMatchedEvent") public void connectionNotMatchedEvent( @ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName) { PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName); if (this.poolInfo.equals(poolInfo)) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Connection not matched event received - " + "poolName = " + poolName); } numConnNotSuccessfullyMatched.increment(); } }
/** * Whenever connection timed-out event occurs, increment numConnTimedOut * * @param pool JdbcConnectionPool that got a connTimedOutEvent */ @ProbeListener(JDBC_PROBE_LISTENER + "connectionTimedOutEvent") public void connectionTimedOutEvent( @ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName) { // handle the conn timed out probe event PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName); if (this.poolInfo.equals(poolInfo)) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Connection Timed-out event received - poolName = " + poolName); } // Increment counter numConnTimedOut.increment(); } }
/** * Event that a connection request is served in timeTakenInMillis. * * @param poolName * @param timeTakenInMillis */ @ProbeListener(JDBC_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); } }
/** * Whenever connection leak happens, increment numConnFailedValidation * * @param pool JdbcConnectionPool that got a failed validation event */ @ProbeListener(JDBC_PROBE_LISTENER + "connectionValidationFailedEvent") public void connectionValidationFailedEvent( @ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName, @ProbeParam("increment") int increment) { PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName); if (this.poolInfo.equals(poolInfo)) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Connection Validation Failed event received - " + "poolName = " + poolName); } // TODO V3 : add support in CounterImpl for addAndGet(increment) numConnFailedValidation.increment(increment); } }
/** * Whenever connection leak happens, increment numPotentialConnLeak * * @param pool JdbcConnectionPool that got a connLeakEvent */ @ProbeListener(JDBC_PROBE_LISTENER + "potentialConnLeakEvent") public void potentialConnLeakEvent( @ProbeParam("poolName") String poolName, @ProbeParam("appName") String appName, @ProbeParam("moduleName") String moduleName) { // handle the conn leak probe event PoolInfo poolInfo = new PoolInfo(poolName, appName, moduleName); if (this.poolInfo.equals(poolInfo)) { if (logger.isLoggable(Level.FINEST)) { logger.finest("Connection Leak event received - poolName = " + poolName); } // TODO V3: Checking if this is a valid event // Increment counter numPotentialConnLeak.increment(); } }
@ProbeListener("fooblog:samples:ProbeServlet:myProbe") public void probe(String s) { servletRequestCount.increment(); System.out.println("PROBE LISTENER HERE. Called with this arg: " + s); }