public void init() { cacheServerStats = new CacheServerStats("Test Sock Name"); bridge = new CacheServerBridge(); bridge.addCacheServerStats(cacheServerStats); }
public void startJob() { incConnectionThreads(); } public void endJob() {
public void cleanup(boolean timedOut) { if (cleanup() && timedOut) { this.stats.incConnectionsTimedOut(); } } public boolean cleanup() {
private boolean acceptHandShake(byte epType, int qSize) { try { this.handshake.accept(SocketUtils.getOutputStream(theSocket), SocketUtils.getInputStream(this.theSocket)//this.theSocket , epType, qSize, this.communicationMode, this.principal); } catch (IOException ioe) { if (!crHelper.isShutdown() && !isTerminated()) { logger.warn(LocalizedMessage.create(LocalizedStrings. ServerConnection_0_HANDSHAKE_ACCEPT_FAILED_ON_SOCKET_1_2, new Object[] {this.name, this.theSocket, ioe})); } cleanup(); return false; } if (logger.isDebugEnabled()) { logger.debug("{}: Accepted handshake", this.name); } if (this.communicationMode == Acceptor.CLIENT_TO_SERVER_FOR_QUEUE) { this.stats.incCurrentQueueConnections(); } else { this.stats.incCurrentClientConnections(); } return true; }
public void testServerStats() throws InterruptedException{ long startTime = System.currentTimeMillis(); cacheServerStats.incCurrentClients(); cacheServerStats.incConnectionThreads(); cacheServerStats.incThreadQueueSize(); cacheServerStats.incCurrentClientConnections(); cacheServerStats.incFailedConnectionAttempts(); cacheServerStats.incConnectionsTimedOut(); cacheServerStats.incReadQueryRequestTime(startTime); cacheServerStats.incSentBytes(20); cacheServerStats.incReceivedBytes(20); cacheServerStats.incReadGetRequestTime(startTime); cacheServerStats.incProcessGetTime(startTime); cacheServerStats.incReadPutRequestTime(startTime); cacheServerStats.incProcessPutTime(startTime); cacheServerStats.setLoad(load);
stats.incReadPutRequestTime(start - oldStart); long oldStart = start; start = DistributionStats.getStatTime(); stats.incProcessPutTime(start - oldStart); logger.debug("{}: Sent 6.1 put response back to {} for region {} key {} value {}", servConn.getName(), servConn.getSocketString(), regionName, key, valuePart); stats.incWritePutResponseTime(DistributionStats.getStatTime() - start);
stats.incReadGetRequestTime(start - oldStart); stats.incProcessGetTime(start - oldStart); logger.debug("{}: Wrote get response back to {} for region {} key {} value: {}", servConn.getName(), servConn.getSocketString(), regionName, key, data); stats.incWriteGetResponseTime(DistributionStats.getStatTime() - start);
this.stats = GatewayReceiverStats.createGatewayReceiverStats(sockName); }else{ this.stats = new CacheServerStats(sockName); tmp_pool = new PooledExecutorWithDMStats(new LinkedBlockingQueue(), this.maxThreads, getStats().getCnxPoolHelper(), socketThreadFactory, Integer.MAX_VALUE); this.stats.close(); this.serverSock.close(); throw poolInitException; this.stats.close(); this.serverSock.close(); this.pool.shutdownNow();
protected void refuseHandshake(String msg, byte exception) { try { ServerHandShakeProcessor.refuse(this.theSocket.getOutputStream(), msg, exception); } catch (IOException ignore) { } finally { this.stats.incFailedConnectionAttempts(); cleanup(); } }
numRefs.incr(); this.incedCleanupTableRef = true; this.stats.incCurrentClients(); result = true;
stats.incReadPutRequestTime(start - oldStart); long oldStart = start; start = DistributionStats.getStatTime(); stats.incProcessPutTime(start - oldStart); logger.debug("{}: Sent put response back to {} for region {} key {} value {}", servConn.getName(), servConn.getSocketString(), regionName, key, valuePart); stats.incWritePutResponseTime(DistributionStats.getStatTime() - start);
stats.incReadGetRequestTime(start - oldStart); stats.incProcessGetTime(start - oldStart); logger.debug("{}: Wrote get response back to {} for region {} {}", servConn.getName(), servConn.getSocketString(), regionName, entry); stats.incWriteGetResponseTime(DistributionStats.getStatTime() - start);
this.stats = GatewayReceiverStats.createGatewayReceiverStats(sockName); }else{ this.stats = new CacheServerStats(sockName); tmp_pool = new PooledExecutorWithDMStats(new LinkedBlockingQueue(), this.maxThreads, getStats().getCnxPoolHelper(), socketThreadFactory, Integer.MAX_VALUE); this.stats.close(); this.serverSock.close(); throw poolInitException; this.stats.close(); this.serverSock.close(); this.pool.shutdownNow();
protected void refuseHandshake(String msg, byte exception) { try { ServerHandShakeProcessor.refuse(this.theSocket.getOutputStream(), msg, exception); } catch (IOException ignore) { } finally { this.stats.incFailedConnectionAttempts(); cleanup(); } }
private boolean acceptHandShake(byte epType, int qSize) { try { this.handshake.accept(this.theSocket.getOutputStream(), this.theSocket .getInputStream(), epType, qSize, this.communicationMode, this.principal); } catch (IOException ioe) { if (!crHelper.isShutdown() && !isTerminated()) { if (this.logger.warningEnabled()) { this.logger.warning(LocalizedStrings. ServerConnection_0_HANDSHAKE_ACCEPT_FAILED_ON_SOCKET_1_2, new Object[] {this.name, this.theSocket, ioe}); } } cleanup(); return false; } if (logger.fineEnabled()) { logger.fine(this.name + ": Accepted handshake"); } if (this.communicationMode == Acceptor.CLIENT_TO_SERVER_FOR_QUEUE) { this.stats.incCurrentQueueConnections(); } else { this.stats.incCurrentClientConnections(); } return true; }
numRefs.incr(); this.incedCleanupTableRef = true; this.stats.incCurrentClients(); result = true;
stats.incReadPutRequestTime(start - oldStart); long oldStart = start; start = DistributionStats.getStatTime(); stats.incProcessPutTime(start - oldStart); logger.debug("{}: Sent put response back to {} for region {} key {} value {}", servConn.getName(), servConn.getSocketString(), regionName, key, valuePart); stats.incWritePutResponseTime(DistributionStats.getStatTime() - start);
stats.incReadGetRequestTime(start - oldStart); stats.incProcessGetTime(start - oldStart); + " key " + key + " value: " + data); stats.incWriteGetResponseTime(DistributionStats.getStatTime() - start);
connection.stats.incFailedConnectionAttempts(); connection.cleanup(); validHandShake = false; connection.stats.incFailedConnectionAttempts(); connection.cleanup(); validHandShake = false; .toLocalizedString(new Object[] { e.getMessage(), Acceptor.VERSION.toString() }), REPLY_REFUSED); connection.stats.incFailedConnectionAttempts(); connection.cleanup(); validHandShake = false;
public void cleanup(boolean timedOut) { if (cleanup() && timedOut) { this.stats.incConnectionsTimedOut(); } } public boolean cleanup() {