public void messageSent(){ long currentTime = System.currentTimeMillis(); long time = 0; if (lastTime < 0){ time = 0; lastTime = currentTime; }else{ time = currentTime-lastTime; } timeStatistic.addTime(time); lastTime=currentTime; }
public synchronized void addTime(long time) { count++; totalTime += time; if (time > maxTime) { maxTime = time; } if (time < minTime || minTime == 0) { minTime = time; } updateSampleTime(); if (parent != null) { parent.addTime(time); } }
public void onMessage() { if (enabled) { long start = messageCount.getLastSampleTime(); messageCount.increment(); long end = messageCount.getLastSampleTime(); messageRateTime.addTime(end - start); } }
destinationStatistics.getBlockedTime().addTime(totalTimeBlocked); producerBrokerExchange.incrementTimeBlocked(this,totalTimeBlocked); producerBrokerExchange.blockingOnFlowControl(false);
if (getBrokerService().isEnableStatistics()) { long totalTime = endTime - message.getBrokerInTime(); ((Destination) message.getRegionDestination()).getDestinationStatistics().getProcessTime().addTime(totalTime);
public void messageSent(){ long currentTime = System.currentTimeMillis(); long time = 0; if (lastTime < 0){ time = 0; lastTime = currentTime; }else{ time = currentTime-lastTime; } timeStatistic.addTime(time); lastTime=currentTime; }
public void messageSent(){ long currentTime = System.currentTimeMillis(); long time = 0; if (lastTime < 0){ time = 0; lastTime = currentTime; }else{ time = currentTime-lastTime; } timeStatistic.addTime(time); lastTime=currentTime; }
public void messageSent(){ long currentTime = System.currentTimeMillis(); long time = 0; if (lastTime < 0){ time = 0; lastTime = currentTime; }else{ time = currentTime-lastTime; } timeStatistic.addTime(time); lastTime=currentTime; }
public synchronized void addTime(long time) { count++; totalTime += time; if (time > maxTime) { maxTime = time; } if (time < minTime || minTime == 0) { minTime = time; } updateSampleTime(); if (parent != null) { parent.addTime(time); } }
public synchronized void addTime(long time) { count++; totalTime += time; if (time > maxTime) { maxTime = time; } if (time < minTime || minTime == 0) { minTime = time; } updateSampleTime(); if (parent != null) { parent.addTime(time); } }
public synchronized void addTime(long time) { count++; totalTime += time; if (time > maxTime) { maxTime = time; } if (time < minTime || minTime == 0) { minTime = time; } updateSampleTime(); if (parent != null) { parent.addTime(time); } }
public synchronized void addTime(long time) { count++; totalTime += time; if (time > maxTime) { maxTime = time; } if (time < minTime || minTime == 0) { minTime = time; } updateSampleTime(); if (parent != null) { parent.addTime(time); } }
public void onMessage() { if (enabled) { long start = messageCount.getLastSampleTime(); messageCount.increment(); long end = messageCount.getLastSampleTime(); messageRateTime.addTime(end - start); } }
public void onMessage() { if (enabled) { long start = messageCount.getLastSampleTime(); messageCount.increment(); long end = messageCount.getLastSampleTime(); messageRateTime.addTime(end - start); } }
public void onMessage() { if (enabled) { long start = messageCount.getLastSampleTime(); messageCount.increment(); long end = messageCount.getLastSampleTime(); messageRateTime.addTime(end - start); } }
public void onMessage() { if (enabled) { long start = messageCount.getLastSampleTime(); messageCount.increment(); long end = messageCount.getLastSampleTime(); messageRateTime.addTime(end - start); } }
@Override public void preProcessDispatch(MessageDispatch messageDispatch) { Message message = messageDispatch.getMessage(); if (message != null) { long endTime = System.currentTimeMillis(); message.setBrokerOutTime(endTime); if (getBrokerService().isEnableStatistics()) { long totalTime = endTime - message.getBrokerInTime(); message.getRegionDestination().getDestinationStatistics().getProcessTime().addTime(totalTime); } } }
protected final void waitForSpace(ConnectionContext context, ProducerBrokerExchange producerBrokerExchange, Usage<?> usage, int highWaterMark, String warning) throws IOException, InterruptedException, ResourceAllocationException { if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) { getLog().debug("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning); throw new ResourceAllocationException(warning); } if (!context.isNetworkConnection() && systemUsage.getSendFailIfNoSpaceAfterTimeout() != 0) { if (!usage.waitForSpace(systemUsage.getSendFailIfNoSpaceAfterTimeout(), highWaterMark)) { getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning); throw new ResourceAllocationException(warning); } } else { long start = System.currentTimeMillis(); producerBrokerExchange.blockingOnFlowControl(true); destinationStatistics.getBlockedSends().increment(); while (!usage.waitForSpace(1000, highWaterMark)) { if (context.getStopping().get()) { throw new IOException("Connection closed, send aborted."); } if (isFlowControlLogRequired()) { getLog().info("{}: {} (blocking for: {}s)", new Object[]{ usage, warning, new Long(((System.currentTimeMillis() - start) / 1000))}); } } long finish = System.currentTimeMillis(); long totalTimeBlocked = finish - start; destinationStatistics.getBlockedTime().addTime(totalTimeBlocked); producerBrokerExchange.incrementTimeBlocked(this,totalTimeBlocked); producerBrokerExchange.blockingOnFlowControl(false); } }
protected final void waitForSpace(ConnectionContext context, ProducerBrokerExchange producerBrokerExchange, Usage<?> usage, int highWaterMark, String warning) throws IOException, InterruptedException, ResourceAllocationException { if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) { getLog().debug("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning); throw new ResourceAllocationException(warning); } if (!context.isNetworkConnection() && systemUsage.getSendFailIfNoSpaceAfterTimeout() != 0) { if (!usage.waitForSpace(systemUsage.getSendFailIfNoSpaceAfterTimeout(), highWaterMark)) { getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning); throw new ResourceAllocationException(warning); } } else { long start = System.currentTimeMillis(); producerBrokerExchange.blockingOnFlowControl(true); destinationStatistics.getBlockedSends().increment(); while (!usage.waitForSpace(1000, highWaterMark)) { if (context.getStopping().get()) { throw new IOException("Connection closed, send aborted."); } if (isFlowControlLogRequired()) { getLog().info("{}: {} (blocking for: {}s)", new Object[]{ usage, warning, new Long(((System.currentTimeMillis() - start) / 1000))}); } } long finish = System.currentTimeMillis(); long totalTimeBlocked = finish - start; destinationStatistics.getBlockedTime().addTime(totalTimeBlocked); producerBrokerExchange.incrementTimeBlocked(this,totalTimeBlocked); producerBrokerExchange.blockingOnFlowControl(false); } }
protected final void waitForSpace(ConnectionContext context, ProducerBrokerExchange producerBrokerExchange, Usage<?> usage, int highWaterMark, String warning) throws IOException, InterruptedException, ResourceAllocationException { if (!context.isNetworkConnection() && systemUsage.isSendFailIfNoSpace()) { getLog().debug("sendFailIfNoSpace, forcing exception on send, usage: {}: {}", usage, warning); throw new ResourceAllocationException(warning); } if (!context.isNetworkConnection() && systemUsage.getSendFailIfNoSpaceAfterTimeout() != 0) { if (!usage.waitForSpace(systemUsage.getSendFailIfNoSpaceAfterTimeout(), highWaterMark)) { getLog().debug("sendFailIfNoSpaceAfterTimeout expired, forcing exception on send, usage: {}: {}", usage, warning); throw new ResourceAllocationException(warning); } } else { long start = System.currentTimeMillis(); producerBrokerExchange.blockingOnFlowControl(true); destinationStatistics.getBlockedSends().increment(); while (!usage.waitForSpace(1000, highWaterMark)) { if (context.getStopping().get()) { throw new IOException("Connection closed, send aborted."); } if (isFlowControlLogRequired()) { getLog().info("{}: {} (blocking for: {}s)", new Object[]{ usage, warning, new Long(((System.currentTimeMillis() - start) / 1000))}); } } long finish = System.currentTimeMillis(); long totalTimeBlocked = finish - start; destinationStatistics.getBlockedTime().addTime(totalTimeBlocked); producerBrokerExchange.incrementTimeBlocked(this,totalTimeBlocked); producerBrokerExchange.blockingOnFlowControl(false); } }