Search in sources :

Example 6 with AsyncEventQueueStats

use of org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueStats in project geode by apache.

the class MyGatewayEventSubstitutionFilter method checkAsyncEventQueueUnprocessedStats.

public static void checkAsyncEventQueueUnprocessedStats(String asyncQueueId, int events) {
    Set<AsyncEventQueue> asyncQueues = cache.getAsyncEventQueues();
    AsyncEventQueue queue = null;
    for (AsyncEventQueue q : asyncQueues) {
        if (q.getId().equals(asyncQueueId)) {
            queue = q;
            break;
        }
    }
    final AsyncEventQueueStats statistics = ((AsyncEventQueueImpl) queue).getStatistics();
    assertEquals(events, (statistics.getUnprocessedEventsAddedBySecondary() + statistics.getUnprocessedTokensRemovedBySecondary()));
    assertEquals(events, (statistics.getUnprocessedEventsRemovedByPrimary() + statistics.getUnprocessedTokensAddedByPrimary()));
}
Also used : AsyncEventQueue(org.apache.geode.cache.asyncqueue.AsyncEventQueue) AsyncEventQueueImpl(org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueImpl) AsyncEventQueueStats(org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueStats)

Aggregations

AsyncEventQueueStats (org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueStats)6 AsyncEventQueue (org.apache.geode.cache.asyncqueue.AsyncEventQueue)5 AsyncEventQueueImpl (org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueImpl)5 AsyncEventQueueMBeanBridge (org.apache.geode.management.internal.beans.AsyncEventQueueMBeanBridge)1