use of org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl in project ignite by apache.
the class GridCacheAbstractMetricsSelfTest method testPutTime.
/**
*/
@Test
public void testPutTime() throws Exception {
IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
HistogramMetricImpl putTime = metric("PutTime");
HistogramMetricImpl putAllTime = metric("PutAllTime");
assertTrue(stream(putTime.value()).allMatch(v -> v == 0));
assertTrue(stream(putAllTime.value()).allMatch(v -> v == 0));
cache.put(1, 1);
cache.putAsync(2, 2).get();
assertTrue(waitForCondition(() -> stream(putTime.value()).sum() == 2, getTestTimeout()));
assertEquals(0, stream(putAllTime.value()).sum());
cache.putAll(F.asMap(3, 3));
cache.putAllAsync(F.asMap(4, 4)).get();
assertTrue(waitForCondition(() -> stream(putAllTime.value()).sum() == 2, getTestTimeout()));
assertEquals(2, stream(putTime.value()).sum());
}
use of org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl in project ignite by apache.
the class GridCacheAbstractMetricsSelfTest method testGetAllOutTx.
/**
*/
@Test
public void testGetAllOutTx() throws Exception {
IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
HistogramMetricImpl getAllTime = metric("GetAllTime");
assertTrue(stream(getAllTime.value()).allMatch(v -> v == 0));
cache.getAllOutTx(singleton(1));
assertTrue(waitForCondition(() -> stream(getAllTime.value()).sum() == 1, getTestTimeout()));
cache.getAllOutTxAsync(singleton(1)).get();
assertTrue(waitForCondition(() -> stream(getAllTime.value()).sum() == 2, getTestTimeout()));
}
use of org.apache.ignite.internal.processors.metric.impl.HistogramMetricImpl in project ignite by apache.
the class GridCacheAbstractMetricsSelfTest method testGetTime.
/**
*/
@Test
public void testGetTime() throws Exception {
IgniteCache<Integer, Integer> cache = grid(0).cache(DEFAULT_CACHE_NAME);
HistogramMetricImpl getTime = metric("GetTime");
HistogramMetricImpl getAllTime = metric("GetAllTime");
assertTrue(stream(getTime.value()).allMatch(v -> v == 0));
assertTrue(stream(getAllTime.value()).allMatch(v -> v == 0));
cache.get(1);
cache.getAsync(1).get();
assertTrue(waitForCondition(() -> stream(getTime.value()).sum() == 2, getTestTimeout()));
assertEquals(0, stream(getAllTime.value()).sum());
cache.getAll(singleton(1));
cache.getAllAsync(singleton(1)).get();
assertTrue(waitForCondition(() -> stream(getAllTime.value()).sum() == 2, getTestTimeout()));
assertEquals(2, stream(getTime.value()).sum());
}
Aggregations