/** * During sender is getting stopped, if there are any cache operation on queue then that event will be stored in temp queue. * Once sender is started, these event from tmp queue will be cleared. */ public void clearTempEventsAfterSenderStopped() { TmpQueueEvent nextEvent = null; while ((nextEvent = tmpQueuedEvents.poll()) != null) { nextEvent.release(); } synchronized (this.queuedEventsSync) { while ((nextEvent = tmpQueuedEvents.poll()) != null) { nextEvent.release(); } this.enqueuedAllTempQueueEvents = false; } statistics.setQueueSize(0); statistics.setTempQueueSize(0); }
this.unprocessedEvents.size()); GatewaySenderStats statistics = this.sender.getStatistics(); statistics.setQueueSize(eventQueueSize()); // to capture an initial
public void testSenderStats() throws InterruptedException{ senderStats.incBatchesRedistributed(); senderStats.incEventsReceived(); senderStats.setQueueSize(10); senderStats.endPut(testStartTime); senderStats.endBatch(testStartTime, 100); senderStats.incEventsNotQueuedConflated(); sample(); assertEquals(1, getTotalBatchesRedistributed()); assertEquals(1, getTotalEventsConflated()); assertEquals(10, getEventQueueSize()); assertTrue(getEventsQueuedRate() >0); assertTrue(getEventsReceivedRate() >0); assertTrue(getBatchesDispatchedRate() >0); assertTrue(getAverageDistributionTimePerBatch() >0); }