use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testOtherOperationCount_keySet.
@Test
public void testOtherOperationCount_keySet() {
MultiMap map = getMultiMap();
for (int i = 0; i < OPERATION_COUNT; i++) {
map.keySet();
}
LocalMapStats stats = getMultiMapStats();
assertEquals(OPERATION_COUNT, stats.getOtherOperationCount());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testOtherOperationCount_values.
@Test
public void testOtherOperationCount_values() {
MultiMap map = getMultiMap();
for (int i = 0; i < OPERATION_COUNT; i++) {
map.values();
}
LocalMapStats stats = getMultiMapStats();
assertEquals(OPERATION_COUNT, stats.getOtherOperationCount());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testOtherOperationCount_localKeySet.
@Test
public void testOtherOperationCount_localKeySet() {
MultiMap map = getMultiMap();
for (int i = 0; i < OPERATION_COUNT; i++) {
map.localKeySet();
}
LocalMapStats stats = getMultiMapStats();
assertEquals(OPERATION_COUNT, stats.getOtherOperationCount());
}
use of com.hazelcast.map.LocalMapStats in project hazelcast by hazelcast.
the class LocalMultiMapStatsTest method testLastAccessTime_updatedConcurrently.
@Test
public void testLastAccessTime_updatedConcurrently() {
final long startTime = Clock.currentTimeMillis();
final MultiMap<String, String> map = getMultiMap();
final String key = "key";
map.put(key, "value");
map.put(key, "value");
final LocalMapStats localMapStats = getMultiMapStats();
final long lastUpdateTime = localMapStats.getLastUpdateTime();
new Thread(() -> {
sleepAtLeastMillis(1);
map.put(key, "value2");
// causes the local stats object to update
getMultiMapStats();
}).start();
assertTrue(lastUpdateTime >= startTime);
assertTrueEventually(() -> assertTrue(localMapStats.getLastUpdateTime() > lastUpdateTime));
}
Aggregations