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);
}
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()));
}
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());
}
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);
}
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());
}
Aggregations