use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testOtherOperationCount_size.
@Test
public void testOtherOperationCount_size() {
MultiMap map = getMultiMap();
for (int i = 0; i < OPERATION_COUNT; i++) {
map.size();
}
LocalMapStats stats = getMultiMapStats();
assertEquals(OPERATION_COUNT, stats.getOtherOperationCount());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class MapStoreTest method issue614.
@Test(timeout = 120000)
public void issue614() {
final ConcurrentMap<Long, String> STORE = new ConcurrentHashMap<>();
STORE.put(1L, "Event1");
STORE.put(2L, "Event2");
STORE.put(3L, "Event3");
STORE.put(4L, "Event4");
STORE.put(5L, "Event5");
STORE.put(6L, "Event6");
Config config = getConfig();
config.getMapConfig("map").setMapStoreConfig(new MapStoreConfig().setWriteDelaySeconds(1).setImplementation(new SimpleMapStore<>(STORE)));
TestHazelcastInstanceFactory nodeFactory = createHazelcastInstanceFactory(3);
HazelcastInstance instance = nodeFactory.newHazelcastInstance(config);
IMap map = instance.getMap("map");
map.values();
LocalMapStats localMapStats = map.getLocalMapStats();
assertEquals(0, localMapStats.getDirtyEntryCount());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class ClientMapTest method testMapSetWithTtlAndMaxIdleStatistics.
@Test
public void testMapSetWithTtlAndMaxIdleStatistics() {
String name = randomString();
IMap<Integer, Integer> map = client.getMap(name);
int operationCount = 467;
for (int i = 0; i < operationCount; i++) {
map.set(i, i, 1, TimeUnit.MINUTES, 1, TimeUnit.MINUTES);
map.remove(i);
}
LocalMapStats localMapStats = server.getMap(name).getLocalMapStats();
assertEquals("put count", 0, localMapStats.getPutOperationCount());
assertEquals("set count", operationCount, localMapStats.getSetOperationCount());
assertEquals("get count", 0, localMapStats.getGetOperationCount());
assertEquals("remove count", operationCount, localMapStats.getRemoveOperationCount());
assertTrue("set latency", localMapStats.getTotalSetLatency() > 0);
assertTrue("max set latency", localMapStats.getMaxSetLatency() > 0);
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class ClientMapTest method testMapSetWithTtlStatistics.
@Test
public void testMapSetWithTtlStatistics() {
String name = randomString();
IMap<Integer, Integer> map = client.getMap(name);
int operationCount = 1000;
for (int i = 0; i < operationCount; i++) {
map.set(i, i, 1, TimeUnit.MINUTES);
map.remove(i);
}
LocalMapStats localMapStats = server.getMap(name).getLocalMapStats();
assertEquals("put count", 0, localMapStats.getPutOperationCount());
assertEquals("set count", operationCount, localMapStats.getSetOperationCount());
assertEquals("get count", 0, localMapStats.getGetOperationCount());
assertEquals("remove count", operationCount, localMapStats.getRemoveOperationCount());
assertTrue("set latency", localMapStats.getTotalSetLatency() > 0);
assertTrue("max set latency", localMapStats.getMaxSetLatency() > 0);
}
use of com.hazelcast.map.LocalMapStats in project Payara by payara.
the class ClusteredStore method collect.
@Override
public void collect(MonitoringDataCollector collector) {
if (hzCore.isEnabled()) {
try (Context ctx = ctxUtil.empty().pushContext()) {
HazelcastInstance hz = hzCore.getInstance();
for (DistributedObject obj : hz.getDistributedObjects()) {
if (MapService.SERVICE_NAME.equals(obj.getServiceName())) {
MapConfig config = hz.getConfig().getMapConfig(obj.getName());
if (config.isStatisticsEnabled()) {
IMap<Object, Object> map = hz.getMap(obj.getName());
if (map != null) {
LocalMapStats stats = map.getLocalMapStats();
collector.in("map").group(map.getName()).collect("GetCount", stats.getGetOperationCount()).collect("PutCount", stats.getPutOperationCount()).collect("EntryCount", stats.getOwnedEntryCount());
}
}
}
}
}
}
}
Aggregations