Search in sources :

Example 1 with LongAdderMetric

use of org.apache.ignite.internal.processors.metric.impl.LongAdderMetric in project ignite by apache.

the class BPlusTreeBenchmark method createPageMemory.

/**
 * @return Page memory.
 */
private PageMemory createPageMemory() {
    DataRegionConfiguration dataRegionConfiguration = new DataRegionConfiguration().setMaxSize(1024 * MB);
    DataRegionMetricsImpl dataRegionMetrics = mock(DataRegionMetricsImpl.class);
    PageMetrics pageMetrics = mock(PageMetrics.class);
    LongAdderMetric noOpMetric = new LongAdderMetric("foobar", null);
    when(dataRegionMetrics.cacheGrpPageMetrics(anyInt())).thenReturn(pageMetrics);
    when(pageMetrics.totalPages()).thenReturn(noOpMetric);
    when(pageMetrics.indexPages()).thenReturn(noOpMetric);
    PageMemory pageMem = new PageMemoryNoStoreImpl(new JavaLogger(), new UnsafeMemoryProvider(new JavaLogger()), null, PAGE_SIZE, dataRegionConfiguration, dataRegionMetrics, false);
    pageMem.start();
    return pageMem;
}
Also used : DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) PageMemoryNoStoreImpl(org.apache.ignite.internal.pagemem.impl.PageMemoryNoStoreImpl) PageMemory(org.apache.ignite.internal.pagemem.PageMemory) PageMetrics(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMetrics) LongAdderMetric(org.apache.ignite.internal.processors.metric.impl.LongAdderMetric) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) JavaLogger(org.apache.ignite.logger.java.JavaLogger) UnsafeMemoryProvider(org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)

Example 2 with LongAdderMetric

use of org.apache.ignite.internal.processors.metric.impl.LongAdderMetric in project ignite by apache.

the class PageMemoryImplTest method testCheckpointBufferCantOverflowWithThrottlingMixedLoad.

/**
 * @throws Exception If failed.
 */
private void testCheckpointBufferCantOverflowWithThrottlingMixedLoad(PageMemoryImpl.ThrottlingPolicy plc) throws Exception {
    PageMemoryImpl memory = createPageMemory(plc, null);
    List<FullPageId> pages = new ArrayList<>();
    for (int i = 0; i < (MAX_SIZE - 10) * MB / PAGE_SIZE / 2; i++) {
        long pageId = memory.allocatePage(1, INDEX_PARTITION, FLAG_IDX);
        FullPageId fullPageId = new FullPageId(pageId, 1);
        pages.add(fullPageId);
        acquireAndReleaseWriteLock(memory, fullPageId);
    }
    memory.beginCheckpoint(new GridFinishedFuture());
    CheckpointMetricsTracker mockTracker = Mockito.mock(CheckpointMetricsTracker.class);
    for (FullPageId checkpointPage : pages) memory.checkpointWritePage(checkpointPage, ByteBuffer.allocate(PAGE_SIZE), (fullPageId, buffer, tag) -> {
    // No-op.
    }, mockTracker);
    memory.finishCheckpoint();
    for (int i = (int) ((MAX_SIZE - 10) * MB / PAGE_SIZE / 2); i < (MAX_SIZE - 20) * MB / PAGE_SIZE; i++) {
        long pageId = memory.allocatePage(1, INDEX_PARTITION, FLAG_IDX);
        FullPageId fullPageId = new FullPageId(pageId, 1);
        pages.add(fullPageId);
        acquireAndReleaseWriteLock(memory, fullPageId);
    }
    memory.beginCheckpoint(new GridFinishedFuture());
    // Mix pages in checkpoint with clean pages
    Collections.shuffle(pages);
    AtomicBoolean stop = new AtomicBoolean(false);
    try {
        GridTestUtils.runAsync(() -> {
            for (FullPageId page : pages) {
                if (// Mark dirty 50% of pages
                ThreadLocalRandom.current().nextDouble() < 0.5)
                    try {
                        acquireAndReleaseWriteLock(memory, page);
                        if (stop.get())
                            break;
                    } catch (IgniteCheckedException e) {
                        log.error("runAsync ended with exception", e);
                        fail();
                    }
            }
        }).get(5_000);
    } catch (IgniteFutureTimeoutCheckedException ignore) {
    // Expected.
    } finally {
        stop.set(true);
    }
    memory.finishCheckpoint();
    LongAdderMetric totalThrottlingTime = U.field(memory.metrics(), "totalThrottlingTime");
    assertNotNull(totalThrottlingTime);
    assertTrue(totalThrottlingTime.value() > 0);
}
Also used : PageStore(org.apache.ignite.internal.pagemem.store.PageStore) GridFinishedFuture(org.apache.ignite.internal.util.future.GridFinishedFuture) ByteBuffer(java.nio.ByteBuffer) NoopMetricExporterSpi(org.apache.ignite.spi.metric.noop.NoopMetricExporterSpi) GridSystemViewManager(org.apache.ignite.internal.managers.systemview.GridSystemViewManager) UnsafeMemoryProvider(org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider) IgnitePluginProcessor(org.apache.ignite.internal.processors.plugin.IgnitePluginProcessor) AtomicInteger(java.util.concurrent.atomic.AtomicInteger) LongAdderMetric(org.apache.ignite.internal.processors.metric.impl.LongAdderMetric) Map(java.util.Map) PageUtils(org.apache.ignite.internal.pagemem.PageUtils) GridTestLog4jLogger(org.apache.ignite.testframework.junits.logger.GridTestLog4jLogger) FailureProcessor(org.apache.ignite.internal.processors.failure.FailureProcessor) CheckpointProgressImpl(org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgressImpl) IgniteInClosure(org.apache.ignite.lang.IgniteInClosure) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) IgniteOutClosure(org.apache.ignite.lang.IgniteOutClosure) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) DirectMemoryProvider(org.apache.ignite.internal.mem.DirectMemoryProvider) GridInternalSubscriptionProcessor(org.apache.ignite.internal.processors.subscription.GridInternalSubscriptionProcessor) GridTestUtils(org.apache.ignite.testframework.GridTestUtils) INDEX_PARTITION(org.apache.ignite.internal.pagemem.PageIdAllocator.INDEX_PARTITION) ByteOrder(java.nio.ByteOrder) Nullable(org.jetbrains.annotations.Nullable) List(java.util.List) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) IgnitePageStoreManager(org.apache.ignite.internal.pagemem.store.IgnitePageStoreManager) PerformanceStatisticsProcessor(org.apache.ignite.internal.processors.performancestatistics.PerformanceStatisticsProcessor) IgniteFutureTimeoutCheckedException(org.apache.ignite.internal.IgniteFutureTimeoutCheckedException) IgniteOutOfMemoryException(org.apache.ignite.internal.mem.IgniteOutOfMemoryException) JmxSystemViewExporterSpi(org.apache.ignite.internal.managers.systemview.JmxSystemViewExporterSpi) FLAG_IDX(org.apache.ignite.internal.pagemem.PageIdAllocator.FLAG_IDX) CHECKPOINT_POOL_OVERFLOW_ERROR_MSG(org.apache.ignite.internal.processors.cache.persistence.pagemem.PageMemoryImpl.CHECKPOINT_POOL_OVERFLOW_ERROR_MSG) FullPageId(org.apache.ignite.internal.pagemem.FullPageId) DataRegionMetricsImpl(org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl) GridMultiCollectionWrapper(org.apache.ignite.internal.util.GridMultiCollectionWrapper) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) CheckpointProgress(org.apache.ignite.internal.processors.cache.persistence.checkpoint.CheckpointProgress) U(org.apache.ignite.internal.util.typedef.internal.U) HashMap(java.util.HashMap) AtomicReference(java.util.concurrent.atomic.AtomicReference) ArrayList(java.util.ArrayList) NoopEventStorageSpi(org.apache.ignite.spi.eventstorage.NoopEventStorageSpi) ThreadLocalRandom(java.util.concurrent.ThreadLocalRandom) DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) PageIO(org.apache.ignite.internal.processors.cache.persistence.tree.io.PageIO) GridEncryptionManager(org.apache.ignite.internal.managers.encryption.GridEncryptionManager) NoOpFailureHandler(org.apache.ignite.failure.NoOpFailureHandler) NoopEncryptionSpi(org.apache.ignite.spi.encryption.noop.NoopEncryptionSpi) Test(org.junit.Test) IgniteCacheDatabaseSharedManager(org.apache.ignite.internal.processors.cache.persistence.IgniteCacheDatabaseSharedManager) GridTestKernalContext(org.apache.ignite.testframework.junits.GridTestKernalContext) Mockito(org.mockito.Mockito) GridCacheSharedContext(org.apache.ignite.internal.processors.cache.GridCacheSharedContext) PluginProvider(org.apache.ignite.plugin.PluginProvider) DummyPageIO(org.apache.ignite.internal.processors.cache.persistence.DummyPageIO) PageStoreWriter(org.apache.ignite.internal.processors.cache.persistence.PageStoreWriter) GridMetricManager(org.apache.ignite.internal.processors.metric.GridMetricManager) GridInClosure3X(org.apache.ignite.internal.util.lang.GridInClosure3X) GridEventStorageManager(org.apache.ignite.internal.managers.eventstorage.GridEventStorageManager) Collections(java.util.Collections) ArrayList(java.util.ArrayList) GridFinishedFuture(org.apache.ignite.internal.util.future.GridFinishedFuture) AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) IgniteCheckedException(org.apache.ignite.IgniteCheckedException) IgniteFutureTimeoutCheckedException(org.apache.ignite.internal.IgniteFutureTimeoutCheckedException) LongAdderMetric(org.apache.ignite.internal.processors.metric.impl.LongAdderMetric) FullPageId(org.apache.ignite.internal.pagemem.FullPageId)

Example 3 with LongAdderMetric

use of org.apache.ignite.internal.processors.metric.impl.LongAdderMetric in project ignite by apache.

the class IndexMetricsTest method testIndexRebuildingMetric.

/**
 * @throws Exception If failed.
 */
@Test
public void testIndexRebuildingMetric() throws Exception {
    IgniteEx n = startGrid(0);
    n.cluster().active(true);
    String cacheName1 = "cache1";
    String cacheName2 = "cache2";
    IgniteCache<KeyClass, ValueClass> cache1 = n.getOrCreateCache(cacheConfiguration(cacheName1));
    IgniteCache<KeyClass, ValueClass> cache2 = n.getOrCreateCache(cacheConfiguration(cacheName2));
    int entryCnt1 = 100;
    int entryCnt2 = 200;
    for (int i = 0; i < entryCnt1; i++) cache1.put(new KeyClass(i), new ValueClass((long) i));
    for (int i = 0; i < entryCnt2; i++) cache2.put(new KeyClass(i), new ValueClass((long) i));
    List<Path> idxPaths = getIndexBinPaths(cacheName1);
    idxPaths.addAll(getIndexBinPaths(cacheName2));
    stopAllGrids();
    idxPaths.forEach(idxPath -> assertTrue(U.delete(idxPath)));
    IndexProcessor.idxRebuildCls = BlockingIndexesRebuildTask.class;
    n = startGrid(0);
    BooleanMetric idxRebuildInProgress1 = indexRebuildMetric(n, cacheName1, "IsIndexRebuildInProgress");
    BooleanMetric idxRebuildInProgress2 = indexRebuildMetric(n, cacheName2, "IsIndexRebuildInProgress");
    LongAdderMetric idxRebuildKeyProcessed1 = indexRebuildMetric(n, cacheName1, "IndexRebuildKeyProcessed");
    LongAdderMetric idxRebuildKeyProcessed2 = indexRebuildMetric(n, cacheName2, "IndexRebuildKeyProcessed");
    CacheMetrics cacheMetrics1 = cacheMetrics(n, cacheName1);
    CacheMetrics cacheMetrics2 = cacheMetrics(n, cacheName2);
    CacheMetricsMXBean cacheMetricsMXBean1 = cacheMetricsMXBean(n, cacheName1, CacheLocalMetricsMXBeanImpl.class);
    CacheMetricsMXBean cacheMetricsMXBean2 = cacheMetricsMXBean(n, cacheName2, CacheLocalMetricsMXBeanImpl.class);
    CacheMetricsMXBean cacheClusterMetricsMXBean1 = cacheMetricsMXBean(n, cacheName1, CacheClusterMetricsMXBeanImpl.class);
    CacheMetricsMXBean cacheClusterMetricsMXBean2 = cacheMetricsMXBean(n, cacheName2, CacheClusterMetricsMXBeanImpl.class);
    n.cluster().active(true);
    BooleanSupplier[] idxRebuildProgressCache1 = { idxRebuildInProgress1::value, cacheMetrics1::isIndexRebuildInProgress, cacheMetricsMXBean1::isIndexRebuildInProgress };
    BooleanSupplier[] idxRebuildProgressCache2 = { idxRebuildInProgress2::value, cacheMetrics2::isIndexRebuildInProgress, cacheMetricsMXBean2::isIndexRebuildInProgress };
    // It must always be false, because metric is only per node.
    BooleanSupplier[] idxRebuildProgressCluster = { cacheClusterMetricsMXBean1::isIndexRebuildInProgress, cacheClusterMetricsMXBean2::isIndexRebuildInProgress };
    LongSupplier[] idxRebuildKeyProcessedCache1 = { idxRebuildKeyProcessed1::value, cacheMetrics1::getIndexRebuildKeysProcessed, cacheMetricsMXBean1::getIndexRebuildKeysProcessed };
    LongSupplier[] idxRebuildKeyProcessedCache2 = { idxRebuildKeyProcessed2::value, cacheMetrics2::getIndexRebuildKeysProcessed, cacheMetricsMXBean2::getIndexRebuildKeysProcessed };
    // It must always be 0, because metric is only per node.
    LongSupplier[] idxRebuildKeyProcessedCluster = { cacheClusterMetricsMXBean1::getIndexRebuildKeysProcessed, cacheClusterMetricsMXBean2::getIndexRebuildKeysProcessed };
    assertEquals(true, idxRebuildProgressCache1);
    assertEquals(true, idxRebuildProgressCache2);
    assertEquals(false, idxRebuildProgressCluster);
    assertEquals(0, idxRebuildKeyProcessedCache1);
    assertEquals(0, idxRebuildKeyProcessedCache2);
    assertEquals(0, idxRebuildKeyProcessedCluster);
    ((BlockingIndexesRebuildTask) n.context().indexProcessor().idxRebuild()).stopBlock(cacheName1);
    n.cache(cacheName1).indexReadyFuture().get(30_000);
    assertEquals(false, idxRebuildProgressCache1);
    assertEquals(true, idxRebuildProgressCache2);
    assertEquals(false, idxRebuildProgressCluster);
    assertEquals(entryCnt1, idxRebuildKeyProcessedCache1);
    assertEquals(0, idxRebuildKeyProcessedCache2);
    assertEquals(0, idxRebuildKeyProcessedCluster);
    ((BlockingIndexesRebuildTask) n.context().indexProcessor().idxRebuild()).stopBlock(cacheName2);
    n.cache(cacheName2).indexReadyFuture().get(30_000);
    assertEquals(false, idxRebuildProgressCache1);
    assertEquals(false, idxRebuildProgressCache2);
    assertEquals(false, idxRebuildProgressCluster);
    assertEquals(entryCnt1, idxRebuildKeyProcessedCache1);
    assertEquals(entryCnt2, idxRebuildKeyProcessedCache2);
    assertEquals(0, idxRebuildKeyProcessedCluster);
}
Also used : BooleanMetric(org.apache.ignite.spi.metric.BooleanMetric) KeyClass(org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.KeyClass) BooleanSupplier(java.util.function.BooleanSupplier) Path(java.nio.file.Path) CacheMetrics(org.apache.ignite.cache.CacheMetrics) CacheMetricsMXBean(org.apache.ignite.mxbean.CacheMetricsMXBean) ValueClass(org.apache.ignite.internal.processors.cache.index.AbstractSchemaSelfTest.ValueClass) IgniteEx(org.apache.ignite.internal.IgniteEx) LongAdderMetric(org.apache.ignite.internal.processors.metric.impl.LongAdderMetric) LongSupplier(java.util.function.LongSupplier) Test(org.junit.Test)

Example 4 with LongAdderMetric

use of org.apache.ignite.internal.processors.metric.impl.LongAdderMetric in project ignite by apache.

the class TcpCommunicationStatisticsTest method testStatistics.

/**
 * @throws Exception If failed.
 */
@SuppressWarnings("ConstantConditions")
@Test
public void testStatistics() throws Exception {
    startGrids(2);
    try {
        Object node0consistentId = grid(0).localNode().consistentId();
        Object node1consistentId = grid(1).localNode().consistentId();
        String node0regName = MetricUtils.metricName(COMMUNICATION_METRICS_GROUP_NAME, node0consistentId.toString());
        String node1regName = MetricUtils.metricName(COMMUNICATION_METRICS_GROUP_NAME, node1consistentId.toString());
        // Send custom message from node0 to node1.
        grid(0).context().io().sendToGridTopic(grid(1).cluster().localNode(), GridTopic.TOPIC_IO_TEST, new GridTestMessage(), GridIoPolicy.PUBLIC_POOL);
        latch.await(10, TimeUnit.SECONDS);
        ClusterGroup clusterGrpNode1 = grid(0).cluster().forNodeId(grid(1).localNode().id());
        // Send job from node0 to node1.
        grid(0).compute(clusterGrpNode1).call(new IgniteCallable<Boolean>() {

            @Override
            public Boolean call() throws Exception {
                return Boolean.TRUE;
            }
        });
        synchronized (mux) {
            TcpCommunicationSpiMBean mbean0 = mbean(0);
            TcpCommunicationSpiMBean mbean1 = mbean(1);
            Map<UUID, Long> msgsSentByNode0 = mbean0.getSentMessagesByNode();
            Map<UUID, Long> msgsSentByNode1 = mbean1.getSentMessagesByNode();
            Map<UUID, Long> msgsReceivedByNode0 = mbean0.getReceivedMessagesByNode();
            Map<UUID, Long> msgsReceivedByNode1 = mbean1.getReceivedMessagesByNode();
            UUID nodeId0 = grid(0).localNode().id();
            UUID nodeId1 = grid(1).localNode().id();
            assertEquals(msgsReceivedByNode0.get(nodeId1).longValue(), mbean0.getReceivedMessagesCount());
            assertEquals(msgsReceivedByNode1.get(nodeId0).longValue(), mbean1.getReceivedMessagesCount());
            assertEquals(msgsSentByNode0.get(nodeId1).longValue(), mbean0.getSentMessagesCount());
            assertEquals(msgsSentByNode1.get(nodeId0).longValue(), mbean1.getSentMessagesCount());
            assertEquals(mbean0.getSentMessagesCount(), mbean1.getReceivedMessagesCount());
            assertEquals(mbean1.getSentMessagesCount(), mbean0.getReceivedMessagesCount());
            Map<String, Long> msgsSentByType0 = mbean0.getSentMessagesByType();
            Map<String, Long> msgsSentByType1 = mbean1.getSentMessagesByType();
            Map<String, Long> msgsReceivedByType0 = mbean0.getReceivedMessagesByType();
            Map<String, Long> msgsReceivedByType1 = mbean1.getReceivedMessagesByType();
            // Node0 sent exactly the same types and count of messages as node1 received.
            assertEquals(msgsSentByType0, msgsReceivedByType1);
            // Node1 sent exactly the same types and count of messages as node0 received.
            assertEquals(msgsSentByType1, msgsReceivedByType0);
            assertEquals(1, msgsSentByType0.get(GridTestMessage.class.getName()).longValue());
            assertEquals(1, msgsReceivedByType1.get(GridTestMessage.class.getName()).longValue());
            MetricRegistry mreg0 = grid(0).context().metric().registry(node1regName);
            MetricRegistry mreg1 = grid(1).context().metric().registry(node0regName);
            LongAdderMetric sentMetric = mreg0.findMetric(SENT_MESSAGES_BY_NODE_CONSISTENT_ID_METRIC_NAME);
            assertNotNull(sentMetric);
            assertEquals(mbean0.getSentMessagesCount(), sentMetric.value());
            LongAdderMetric rcvMetric = mreg1.findMetric(RECEIVED_MESSAGES_BY_NODE_CONSISTENT_ID_METRIC_NAME);
            assertNotNull(rcvMetric);
            assertEquals(mbean1.getReceivedMessagesCount(), rcvMetric.value());
            stopGrid(1);
            mreg0 = grid(0).context().metric().registry(node1regName);
            sentMetric = mreg0.findMetric(SENT_MESSAGES_BY_NODE_CONSISTENT_ID_METRIC_NAME);
            // Automatically generated by MetricRegistryCreationListener.
            assertNotNull(sentMetric);
            assertEquals(0, sentMetric.value());
        }
    } finally {
        stopAllGrids();
    }
}
Also used : GridTestMessage(org.apache.ignite.spi.communication.GridTestMessage) MetricRegistry(org.apache.ignite.internal.processors.metric.MetricRegistry) ClusterGroup(org.apache.ignite.cluster.ClusterGroup) IgniteSpiException(org.apache.ignite.spi.IgniteSpiException) IgniteException(org.apache.ignite.IgniteException) LongAdderMetric(org.apache.ignite.internal.processors.metric.impl.LongAdderMetric) UUID(java.util.UUID) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Example 5 with LongAdderMetric

use of org.apache.ignite.internal.processors.metric.impl.LongAdderMetric in project ignite by apache.

the class PagesWriteThrottleSmokeTest method testThrottle.

/**
 * @throws Exception if failed.
 */
@Test
public void testThrottle() throws Exception {
    startGrids(2).active(true);
    try {
        IgniteEx ig = ignite(0);
        final int keyCnt = 2_000_000;
        final AtomicBoolean run = new AtomicBoolean(true);
        final AtomicBoolean zeroDropdown = new AtomicBoolean(false);
        final HitRateMetric putRate10secs = new HitRateMetric("putRate10secs", "", 10_000, 20);
        final HitRateMetric putRate1sec = new HitRateMetric("putRate1sec", "", 1_000, 20);
        GridTestUtils.runAsync(new Runnable() {

            @Override
            public void run() {
                try {
                    Thread.sleep(5000);
                    while (run.get()) {
                        System.out.println("Put rate over last 10 seconds: " + (putRate10secs.value() / 10) + " puts/sec, over last 1 second: " + putRate1sec.value());
                        if (putRate10secs.value() == 0) {
                            zeroDropdown.set(true);
                            run.set(false);
                        }
                        Thread.sleep(1000);
                    }
                } catch (InterruptedException e) {
                    Thread.currentThread().interrupt();
                } finally {
                    run.set(false);
                }
            }
        }, "rate-checker");
        final IgniteCache<Integer, TestValue> cache = ig.getOrCreateCache(CACHE_NAME);
        GridTestUtils.runAsync(new Runnable() {

            @Override
            public void run() {
                long startTs = System.currentTimeMillis();
                for (int i = 0; i < keyCnt * 10 && System.currentTimeMillis() - startTs < 3 * 60 * 1000; i++) {
                    if (!run.get())
                        break;
                    cache.put(ThreadLocalRandom.current().nextInt(keyCnt), new TestValue(ThreadLocalRandom.current().nextInt(), ThreadLocalRandom.current().nextInt()));
                    putRate10secs.increment();
                    putRate1sec.increment();
                }
                run.set(false);
            }
        }, "loader");
        while (run.get()) LockSupport.parkNanos(10_000);
        if (zeroDropdown.get()) {
            slowCheckpointEnabled.set(false);
            IgniteInternalFuture cpFut1 = ((IgniteEx) ignite(0)).context().cache().context().database().wakeupForCheckpoint("test");
            IgniteInternalFuture cpFut2 = ((IgniteEx) ignite(1)).context().cache().context().database().wakeupForCheckpoint("test");
            cpFut1.get();
            cpFut2.get();
            fail("Put rate degraded to zero for at least 10 seconds");
        }
        LongAdderMetric totalThrottlingTime = totalThrottlingTime(ig);
        assertTrue(totalThrottlingTime.value() > 0);
    } finally {
        stopAllGrids();
    }
}
Also used : AtomicBoolean(java.util.concurrent.atomic.AtomicBoolean) IgniteEx(org.apache.ignite.internal.IgniteEx) HitRateMetric(org.apache.ignite.internal.processors.metric.impl.HitRateMetric) LongAdderMetric(org.apache.ignite.internal.processors.metric.impl.LongAdderMetric) IgniteInternalFuture(org.apache.ignite.internal.IgniteInternalFuture) GridCommonAbstractTest(org.apache.ignite.testframework.junits.common.GridCommonAbstractTest) Test(org.junit.Test)

Aggregations

LongAdderMetric (org.apache.ignite.internal.processors.metric.impl.LongAdderMetric)10 Test (org.junit.Test)6 GridCommonAbstractTest (org.apache.ignite.testframework.junits.common.GridCommonAbstractTest)5 IgniteEx (org.apache.ignite.internal.IgniteEx)4 AtomicBoolean (java.util.concurrent.atomic.AtomicBoolean)3 AtomicInteger (java.util.concurrent.atomic.AtomicInteger)3 MetricRegistry (org.apache.ignite.internal.processors.metric.MetricRegistry)3 UUID (java.util.UUID)2 ThreadLocalRandom (java.util.concurrent.ThreadLocalRandom)2 IgniteCheckedException (org.apache.ignite.IgniteCheckedException)2 IgniteException (org.apache.ignite.IgniteException)2 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)2 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)2 IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)2 UnsafeMemoryProvider (org.apache.ignite.internal.mem.unsafe.UnsafeMemoryProvider)2 DataRegionMetricsImpl (org.apache.ignite.internal.processors.cache.persistence.DataRegionMetricsImpl)2 File (java.io.File)1 Serializable (java.io.Serializable)1 ByteBuffer (java.nio.ByteBuffer)1 ByteOrder (java.nio.ByteOrder)1