Search in sources :

Example 21 with LocalMapStats

use of com.hazelcast.monitor.LocalMapStats in project hazelcast by hazelcast.

the class NearCachedClientMapProxy method getLocalMapStats.

@Override
public LocalMapStats getLocalMapStats() {
    LocalMapStats localMapStats = super.getLocalMapStats();
    NearCacheStats nearCacheStats = nearCache.getNearCacheStats();
    ((LocalMapStatsImpl) localMapStats).setNearCacheStats(nearCacheStats);
    return localMapStats;
}
Also used : LocalMapStats(com.hazelcast.monitor.LocalMapStats) LocalMapStatsImpl(com.hazelcast.monitor.impl.LocalMapStatsImpl) NearCacheStats(com.hazelcast.monitor.NearCacheStats)

Example 22 with LocalMapStats

use of com.hazelcast.monitor.LocalMapStats in project hazelcast by hazelcast.

the class LocalMapStatsUnderOnGoingClientUpdateTest method stats_generated_when_member_restarted_under_ongoing_client_update.

@Test
public void stats_generated_when_member_restarted_under_ongoing_client_update() throws Exception {
    IMap map = client.getMap(mapName);
    member.shutdown();
    member = factory.newHazelcastInstance();
    map.put(1, 1);
    map.put(2, 2);
    // get internal StatisticsAwareService.
    MapService mapService = getNodeEngineImpl(member).getService(SERVICE_NAME);
    Map<String, LocalMapStats> stats = ((StatisticsAwareService) mapService).getStats();
    LocalMapStats localMapStats = stats.get(mapName);
    // StatisticsAwareService should give right stats.
    assertNotNull("there should be 1 LocalMapStats object", localMapStats);
    assertEquals("Owned entry count should be 2", 2, localMapStats.getOwnedEntryCount());
}
Also used : LocalMapStats(com.hazelcast.monitor.LocalMapStats) IMap(com.hazelcast.core.IMap) StatisticsAwareService(com.hazelcast.spi.StatisticsAwareService) MapService(com.hazelcast.map.impl.MapService) QuickTest(com.hazelcast.test.annotation.QuickTest) Test(org.junit.Test) ParallelTest(com.hazelcast.test.annotation.ParallelTest)

Aggregations

LocalMapStats (com.hazelcast.monitor.LocalMapStats)22 QuickTest (com.hazelcast.test.annotation.QuickTest)20 Test (org.junit.Test)20 ParallelTest (com.hazelcast.test.annotation.ParallelTest)19 AssertTask (com.hazelcast.test.AssertTask)7 HazelcastInstance (com.hazelcast.core.HazelcastInstance)5 IMap (com.hazelcast.core.IMap)5 Config (com.hazelcast.config.Config)4 TestHazelcastInstanceFactory (com.hazelcast.test.TestHazelcastInstanceFactory)4 MapConfig (com.hazelcast.config.MapConfig)3 HashMap (java.util.HashMap)2 EvictionConfig (com.hazelcast.config.EvictionConfig)1 GroupConfig (com.hazelcast.config.GroupConfig)1 MapStoreConfig (com.hazelcast.config.MapStoreConfig)1 MaxSizeConfig (com.hazelcast.config.MaxSizeConfig)1 NearCacheConfig (com.hazelcast.config.NearCacheConfig)1 MapService (com.hazelcast.map.impl.MapService)1 NearCacheStats (com.hazelcast.monitor.NearCacheStats)1 LocalMapStatsImpl (com.hazelcast.monitor.impl.LocalMapStatsImpl)1 StatisticsAwareService (com.hazelcast.spi.StatisticsAwareService)1