Java Code Examples for org.apache.ignite.configuration.IgniteConfiguration#setMetricsUpdateFrequency()

The following examples show how to use org.apache.ignite.configuration.IgniteConfiguration#setMetricsUpdateFrequency() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: CacheMetricsCacheSizeTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setMetricsLogFrequency(5000);
    cfg.setMetricsUpdateFrequency(3000);

    cfg.setCacheConfiguration(new CacheConfiguration<>()
        .setName(DEFAULT_CACHE_NAME)
        .setStatisticsEnabled(true)
        .setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC)
        .setCacheMode(CacheMode.PARTITIONED)
        .setBackups(1)
        .setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL));

    return cfg;
}
 
Example 2
Source File: ClusterNodeMetricsSelfTest.java    From ignite with Apache License 2.0 6 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setCacheConfiguration();
    cfg.setMetricsUpdateFrequency(500);

    CacheConfiguration<Integer, Object> ccfg = defaultCacheConfiguration();
    ccfg.setName(CACHE_NAME);
    ccfg.setStatisticsEnabled(true);

    FifoEvictionPolicy plc = new FifoEvictionPolicy();
    plc.setMaxMemorySize(MAX_VALS_AMOUNT * VAL_SIZE);
    plc.setMaxSize(0);

    ccfg.setEvictionPolicy(plc);
    ccfg.setOnheapCacheEnabled(true);

    return cfg.setCacheConfiguration(ccfg);
}
 
Example 3
Source File: ExternalNonSpringAopSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration() throws Exception {
    IgniteConfiguration cfg = super.getConfiguration();
    cfg.setDeploymentSpi(new LocalDeploymentSpi());

    cfg.setMetricsUpdateFrequency(500);

    cfg.setDeploymentMode(depMode);

    return cfg;
}
 
Example 4
Source File: GridDiscoveryManagerAliveCacheSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    CacheConfiguration cCfg = defaultCacheConfiguration();

    cCfg.setCacheMode(PARTITIONED);
    cCfg.setBackups(1);
    cCfg.setNearConfiguration(new NearCacheConfiguration());
    cCfg.setRebalanceMode(SYNC);
    cCfg.setWriteSynchronizationMode(FULL_SYNC);

    TcpDiscoverySpi disc = (TcpDiscoverySpi)cfg.getDiscoverySpi();

    if (clientMode && ((igniteInstanceName.charAt(igniteInstanceName.length() - 1) - '0') & 1) != 0)
        cfg.setClientMode(true);
    else
        cfg.setClientFailureDetectionTimeout(50000);

    disc.setAckTimeout(1000);
    disc.setSocketTimeout(1000);

    cfg.setCacheConfiguration(cCfg);
    cfg.setMetricsUpdateFrequency(500);

    return cfg;
}
 
Example 5
Source File: GridServiceClientNodeTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setClientFailureDetectionTimeout(30000);
    cfg.setMetricsUpdateFrequency(1000);

    return cfg;
}
 
Example 6
Source File: IgniteSequenceInternalCleanupTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setMetricsUpdateFrequency(10);
    cfg.setActiveOnStart(false);

    AtomicConfiguration atomicCfg = atomicConfiguration();

    assertNotNull(atomicCfg);

    cfg.setAtomicConfiguration(atomicCfg);

    List<CacheConfiguration> cacheCfg = new ArrayList<>();

    for (int i = 0; i < CACHES_CNT; i++) {
        cacheCfg.add(new CacheConfiguration("test" + i).
            setStatisticsEnabled(true).
            setCacheMode(PARTITIONED).
            setAtomicityMode(TRANSACTIONAL).
            setAffinity(new RendezvousAffinityFunction(false, 16)));
    }

    cfg.setCacheConfiguration(cacheCfg.toArray(new CacheConfiguration[cacheCfg.size()]));

    return cfg;
}
 
Example 7
Source File: ClusterNodeMetricsUpdateTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setMetricsUpdateFrequency(500);

    return cfg;
}
 
Example 8
Source File: GridP2PSameClassLoaderSelfTest.java    From ignite with Apache License 2.0 5 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setDeploymentMode(depMode);
    cfg.setMetricsUpdateFrequency(500);

    cfg.setCacheConfiguration();

    return cfg;
}
 
Example 9
Source File: GridP2PDisabledSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setPeerClassLoadingEnabled(false);

    cfg.setDeploymentMode(depMode);

    if (initGar) {
        UriDeploymentSpi depSpi = new UriDeploymentSpi();

        depSpi.setUriList(Collections.singletonList(garFile));

        cfg.setDeploymentSpi(depSpi);
    }

    cfg.setMetricsUpdateFrequency(500);

    return cfg;
}
 
Example 10
Source File: GridCacheAbstractMetricsSelfTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration configuration = super.getConfiguration(igniteInstanceName);
    configuration.setMetricsUpdateFrequency(2000);
    return configuration;
}
 
Example 11
Source File: BinaryMetadataUpdatesFlowTest.java    From ignite with Apache License 2.0 4 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setPeerClassLoadingEnabled(false);

    if (discoveryHook != null) {
        ((TestTcpDiscoverySpi)cfg.getDiscoverySpi()).discoveryHook(discoveryHook);

        cfg.setMetricsUpdateFrequency(1000);
    }

    cfg.setMarshaller(new BinaryMarshaller());

    cfg.setClientMode("client".equals(gridName) || getTestIgniteInstanceIndex(gridName) >= GRID_CNT);

    CacheConfiguration ccfg = new CacheConfiguration(DEFAULT_CACHE_NAME);

    ccfg.setCacheMode(CacheMode.REPLICATED);

    cfg.setCacheConfiguration(ccfg);

    return cfg;
}
 
Example 12
Source File: AbstractAopTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);

    cfg.setDeploymentSpi(new LocalDeploymentSpi());

    cfg.setMetricsUpdateFrequency(500);
    cfg.setDeploymentMode(depMode);

    cfg.setIncludeEventTypes(EventType.EVTS_ALL);

    return cfg;
}
 
Example 13
Source File: TcpDiscoveryClientSuspensionSelfTest.java    From ignite with Apache License 2.0 3 votes vote down vote up
/** {@inheritDoc} */
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(gridName);

    cfg.setMetricsUpdateFrequency(100);

    cfg.setClientFailureDetectionTimeout(1000);

    return cfg;
}