public static void checkStatistics() { try { Cache cache = CacheServerTestUtil.getCache(); com.gemstone.gemfire.LogWriter logger = cache.getLogger(); BridgeServerImpl currentServer = (BridgeServerImpl)(new ArrayList(cache .getBridgeServers()).get(0)); AcceptorImpl ai = currentServer.getAcceptor(); CacheClientNotifier notifier = ai.getCacheClientNotifier(); CacheClientNotifierStats stats = notifier.getStats(); logger.info("Stats:" + "\nDurableReconnectionCount:" + stats.get_durableReconnectionCount() + "\nQueueDroppedCount" + stats.get_queueDroppedCount() + "\nEventsEnqueuedWhileClientAwayCount" + stats.get_eventEnqueuedWhileClientAwayCount()); } catch (Exception e) { fail("Exception thrown while executing checkStatistics()"); } }
public static void checkStatisticsWithExpectedValues(int reconnectionCount, int queueDropCount, int enqueueCount) { try { Cache cache = CacheServerTestUtil.getCache(); com.gemstone.gemfire.LogWriter logger = cache.getLogger(); BridgeServerImpl currentServer = (BridgeServerImpl)(new ArrayList(cache .getBridgeServers()).get(0)); AcceptorImpl ai = currentServer.getAcceptor(); CacheClientNotifier notifier = ai.getCacheClientNotifier(); CacheClientNotifierStats stats = notifier.getStats(); logger.info("Stats:" + "\nDurableReconnectionCount:" + stats.get_durableReconnectionCount() + "\nQueueDroppedCount" + stats.get_queueDroppedCount() + "\nEventsEnqueuedWhileClientAwayCount" + stats.get_eventEnqueuedWhileClientAwayCount()); assertEquals(reconnectionCount, stats.get_durableReconnectionCount()); assertEquals(queueDropCount, stats.get_queueDroppedCount()); assertEquals(enqueueCount, stats.get_eventEnqueuedWhileClientAwayCount()); } catch (Exception e) { fail("Exception thrown while executing checkStatisticsWithExpectedValues()"); } }