use of com.hazelcast.monitor.NearCacheStats in project hazelcast by hazelcast.
the class ClientMapNearCacheTest method testGetAsync.
@Test
public void testGetAsync() throws Exception {
IMap<Integer, Integer> map = getNearCachedMapFromClient(newNoInvalidationNearCacheConfig());
int size = 1009;
populateMap(map, size);
populateNearCache(map, size);
// generate Near Cache hits with async call
for (int i = 0; i < size; i++) {
Future future = map.getAsync(i);
future.get();
}
NearCacheStats stats = getNearCacheStats(map);
assertEquals(size, stats.getOwnedEntryCount());
assertEquals(size, stats.getHits());
}
use of com.hazelcast.monitor.NearCacheStats in project hazelcast by hazelcast.
the class ClientMapNearCacheTest method testGetNearCacheStatsBeforePopulation.
@Test
public void testGetNearCacheStatsBeforePopulation() {
IMap<Integer, Integer> map = getNearCachedMapFromClient(newNoInvalidationNearCacheConfig());
int size = 101;
for (int i = 0; i < size; i++) {
map.put(i, i);
}
NearCacheStats stats = getNearCacheStats(map);
assertNotNull(stats);
}
use of com.hazelcast.monitor.NearCacheStats in project hazelcast by hazelcast.
the class ClientMapNearCacheTest method testNearCachePopulatedAndHitsGenerated_withInterleavedCacheHitGeneration.
@Test
public void testNearCachePopulatedAndHitsGenerated_withInterleavedCacheHitGeneration() {
IMap<Integer, Integer> map = getNearCachedMapFromClient(newNoInvalidationNearCacheConfig());
int size = 1278;
for (int i = 0; i < size; i++) {
map.put(i, i);
// populate Near Cache
map.get(i);
// generate Near Cache hits
map.get(i);
}
NearCacheStats stats = getNearCacheStats(map);
System.out.println("stats = " + stats);
assertEquals(size, stats.getOwnedEntryCount());
assertEquals(size, stats.getHits());
}
use of com.hazelcast.monitor.NearCacheStats in project hazelcast by hazelcast.
the class ClientMapNearCacheTest method testIssue2009.
@Test
public void testIssue2009() {
IMap<Integer, Integer> map = getNearCachedMapFromClient(newInvalidationEnabledNearCacheConfig());
NearCacheStats stats = getNearCacheStats(map);
assertNotNull(stats);
}
use of com.hazelcast.monitor.NearCacheStats in project hazelcast by hazelcast.
the class ClientMapNearCacheTest method testMapRemove_WithNearCache.
@Test
public void testMapRemove_WithNearCache() {
IMap<Integer, Integer> map = getNearCachedMapFromClient(newInvalidationEnabledNearCacheConfig());
int size = 1113;
populateMap(map, size);
populateNearCache(map, size);
for (int i = 0; i < size; i++) {
map.remove(i);
}
NearCacheStats stats = getNearCacheStats(map);
assertEquals(0, stats.getOwnedEntryCount());
assertEquals(size, stats.getMisses());
}
Aggregations