Package com.hazelcast.monitor

Examples of com.hazelcast.monitor.LocalMapStats


                        .setImplementation(new SimpleMapStore<Long, String>(STORE)));
        TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(3);
        HazelcastInstance h = nodeFactory.newHazelcastInstance(config);
        IMap map = h.getMap("map");
        Collection collection = map.values();
        LocalMapStats localMapStats = map.getLocalMapStats();
        assertEquals(0, localMapStats.getDirtyEntryCount());
    }
View Full Code Here


    }

    @Test
    public void testMapStatistics_withClientOperations() {
        final String mapName = randomString();
        final LocalMapStats serverMapStats = server.getMap(mapName).getLocalMapStats();

        final IMap map = client.getMap(mapName);
        final int operationCount = 1123;
        for (int i = 0; i < operationCount; i++) {
            map.put(i, i);
            map.get(i);
            map.remove(i);
        }

        assertEquals("put count", operationCount, serverMapStats.getPutOperationCount());
        assertEquals("get count", operationCount, serverMapStats.getGetOperationCount());
        assertEquals("remove count", operationCount, serverMapStats.getRemoveOperationCount());
        assertTrue("put latency", 0 < serverMapStats.getTotalPutLatency());
        assertTrue("get latency", 0 < serverMapStats.getTotalGetLatency());
        assertTrue("remove latency", 0 < serverMapStats.getTotalRemoveLatency());
    }
View Full Code Here

        for (int i = 0; i < trials; i++) {
            long totalOwned = 0L;
            long totalBackup = 0L;
            for (int j = 0; j < instances.length(); j++) {
                HazelcastInstance hz = instances.get(j);
                LocalMapStats stats = hz.getMap(name).getLocalMapStats();
                totalOwned += stats.getOwnedEntryCount();
                totalBackup += stats.getBackupEntryCount();
            }
            assertEquals("Owned entry count is wrong! ", totalCount, totalOwned);
            if (i < trials - 1) {
                if (totalBackup == totalCount) {
                    break;
View Full Code Here

        IMap<Integer, Integer> map = h1.getMap("hits");
        for (int i = 0; i < 100; i++) {
            map.put(i, i);
            map.get(i);
        }
        LocalMapStats localMapStats = map.getLocalMapStats();
        assertEquals(100, localMapStats.getHits());
        assertEquals(100, localMapStats.getPutOperationCount());
        assertEquals(100, localMapStats.getGetOperationCount());
        localMapStats = map.getLocalMapStats(); // to ensure stats are recalculated correct.
        assertEquals(100, localMapStats.getHits());
        assertEquals(100, localMapStats.getPutOperationCount());
        assertEquals(100, localMapStats.getGetOperationCount());
    }
View Full Code Here

    }

    @Test
    public void testMapStatistics() throws Exception {
        String name = randomString();
        final LocalMapStats localMapStats = server.getMap(name).getLocalMapStats();
        final IMap map = client.getMap(name);

        final int operationCount = 1000;
        for (int i = 0; i < operationCount; i++) {
            map.put(i, i);
            map.get(i);
            map.remove(i);
        }

        assertEquals("put count", operationCount, localMapStats.getPutOperationCount());
        assertEquals("get count", operationCount, localMapStats.getGetOperationCount());
        assertEquals("remove count", operationCount, localMapStats.getRemoveOperationCount());
        assertTrue("put latency", 0 < localMapStats.getTotalPutLatency());
        assertTrue("get latency", 0 < localMapStats.getTotalGetLatency());
        assertTrue("remove latency", 0 < localMapStats.getTotalRemoveLatency());
    }
View Full Code Here

TOP

Related Classes of com.hazelcast.monitor.LocalMapStats

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.