Search in sources :

Example 1 with AsyncEventQueueStats

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

the class AsyncEventQueueStatsJUnitTest method init.

public void init() {
    asyncEventQueueStats = new AsyncEventQueueStats(system, "test");
    bridge = new AsyncEventQueueMBeanBridge();
    bridge.addAsyncEventQueueStats(asyncEventQueueStats);
}
Also used : AsyncEventQueueStats(org.apache.geode.cache.asyncqueue.internal.AsyncEventQueueStats) AsyncEventQueueMBeanBridge(org.apache.geode.management.internal.beans.AsyncEventQueueMBeanBridge)

Example 2 with AsyncEventQueueStats

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

the class MyGatewayEventSubstitutionFilter method checkAsyncEventQueueStats_Failover.

public static void checkAsyncEventQueueStats_Failover(String asyncEventQueueId, final int eventsReceived) {
    Set<AsyncEventQueue> asyncEventQueues = cache.getAsyncEventQueues();
    AsyncEventQueue queue = null;
    for (AsyncEventQueue q : asyncEventQueues) {
        if (q.getId().equals(asyncEventQueueId)) {
            queue = q;
            break;
        }
    }
    final AsyncEventQueueStats statistics = ((AsyncEventQueueImpl) queue).getStatistics();
    assertEquals(eventsReceived, statistics.getEventsReceived());
    assertEquals(eventsReceived, (statistics.getEventsQueued() + statistics.getUnprocessedTokensAddedByPrimary() + statistics.getUnprocessedEventsRemovedByPrimary()));
}
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)

Example 3 with AsyncEventQueueStats

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

the class MyGatewayEventSubstitutionFilter method checkAsyncEventQueueConflatedStats.

public static void checkAsyncEventQueueConflatedStats(String asyncEventQueueId, final int eventsConflated) {
    Set<AsyncEventQueue> queues = cache.getAsyncEventQueues();
    AsyncEventQueue queue = null;
    for (AsyncEventQueue q : queues) {
        if (q.getId().equals(asyncEventQueueId)) {
            queue = q;
            break;
        }
    }
    final AsyncEventQueueStats statistics = ((AsyncEventQueueImpl) queue).getStatistics();
    assertEquals(eventsConflated, statistics.getEventsNotQueuedConflated());
}
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)

Example 4 with AsyncEventQueueStats

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

the class MyGatewayEventSubstitutionFilter method checkAsyncEventQueueStats.

public static void checkAsyncEventQueueStats(String queueId, final int queueSize, final int eventsReceived, final int eventsQueued, final int eventsDistributed) {
    Set<AsyncEventQueue> asyncQueues = cache.getAsyncEventQueues();
    AsyncEventQueue queue = null;
    for (AsyncEventQueue q : asyncQueues) {
        if (q.getId().equals(queueId)) {
            queue = q;
            break;
        }
    }
    final AsyncEventQueueStats statistics = ((AsyncEventQueueImpl) queue).getStatistics();
    assertEquals(queueSize, statistics.getEventQueueSize());
    assertEquals(eventsReceived, statistics.getEventsReceived());
    assertEquals(eventsQueued, statistics.getEventsQueued());
    assert (statistics.getEventsDistributed() >= eventsDistributed);
}
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)

Example 5 with AsyncEventQueueStats

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

the class MyGatewayEventSubstitutionFilter method checkAsyncEventQueueBatchStats.

public static void checkAsyncEventQueueBatchStats(String asyncQueueId, final int batches) {
    Set<AsyncEventQueue> queues = cache.getAsyncEventQueues();
    AsyncEventQueue queue = null;
    for (AsyncEventQueue q : queues) {
        if (q.getId().equals(asyncQueueId)) {
            queue = q;
            break;
        }
    }
    final AsyncEventQueueStats statistics = ((AsyncEventQueueImpl) queue).getStatistics();
    assert (statistics.getBatchesDistributed() >= batches);
    assertEquals(0, statistics.getBatchesRedistributed());
}
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