use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testHitsGenerated_updatedConcurrently.
@Test
public void testHitsGenerated_updatedConcurrently() {
final MultiMap<Integer, Integer> map = getMultiMap();
final int actionCount = 100;
for (int i = 0; i < actionCount; i++) {
map.put(i, i);
map.get(i);
}
final LocalMapStats localMapStats = getMultiMapStats();
final long initialHits = localMapStats.getHits();
new Thread(() -> {
for (int i = 0; i < actionCount; i++) {
map.get(i);
}
// causes the local stats object to update
getMultiMapStats();
}).start();
assertEquals(actionCount, initialHits);
assertTrueEventually(() -> assertEquals(actionCount * 2, localMapStats.getHits()));
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testPutAllAndHitsGeneratedTemplateVerify.
protected void testPutAllAndHitsGeneratedTemplateVerify() {
LocalMapStats localMapStats1 = getMultiMapStats();
LocalMapStats localMapStats2 = getMultiMapStats(mapNameSet);
assertEquals(300, localMapStats1.getOwnedEntryCount());
assertEquals(100, localMapStats1.getPutOperationCount());
assertEquals(100, localMapStats1.getHits());
assertEquals(100, localMapStats2.getOwnedEntryCount());
assertEquals(100, localMapStats2.getPutOperationCount());
assertEquals(100, localMapStats2.getHits());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testOtherOperationCount_clear.
@Test
public void testOtherOperationCount_clear() {
MultiMap map = getMultiMap();
for (int i = 0; i < OPERATION_COUNT; i++) {
map.clear();
}
LocalMapStats stats = getMultiMapStats();
assertEquals(OPERATION_COUNT, stats.getOtherOperationCount());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testLockedEntryCount_emptyMultiMap.
@Test
public void testLockedEntryCount_emptyMultiMap() {
MultiMap<String, String> map = getMultiMap();
map.lock("non-existent-key");
LocalMapStats stats = getMultiMapStats();
assertEquals(1, stats.getLockedEntryCount());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testOtherOperationCount_entrySet.
@Test
public void testOtherOperationCount_entrySet() {
MultiMap map = getMultiMap();
for (int i = 0; i < OPERATION_COUNT; i++) {
map.entrySet();
}
LocalMapStats stats = getMultiMapStats();
assertEquals(OPERATION_COUNT, stats.getOtherOperationCount());
}
Aggregations