Search in sources :

Example 1 with JmxMetricExporterSpi

use of org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi in project ignite by apache.

the class ConfiguringMetrics method newMetrics.

@Test
void newMetrics() {
    // tag::new-metric-framework[]
    IgniteConfiguration cfg = new IgniteConfiguration();
    cfg.setMetricExporterSpi(new JmxMetricExporterSpi(), new SqlViewMetricExporterSpi());
    Ignite ignite = Ignition.start(cfg);
    // end::new-metric-framework[]
    ignite.close();
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) SqlViewMetricExporterSpi(org.apache.ignite.spi.metric.sql.SqlViewMetricExporterSpi) Ignite(org.apache.ignite.Ignite) JmxMetricExporterSpi(org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi) Test(org.junit.jupiter.api.Test)

Example 2 with JmxMetricExporterSpi

use of org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi in project ignite by apache.

the class ConfiguringMetrics method jmxExporter.

@Test
void jmxExporter() {
    // tag::metrics-filter[]
    IgniteConfiguration cfg = new IgniteConfiguration();
    JmxMetricExporterSpi jmxExporter = new JmxMetricExporterSpi();
    // export cache metrics only
    jmxExporter.setExportFilter(mreg -> mreg.name().startsWith("cache."));
    cfg.setMetricExporterSpi(jmxExporter);
    // end::metrics-filter[]
    Ignition.start(cfg).close();
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JmxMetricExporterSpi(org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi) Test(org.junit.jupiter.api.Test)

Example 3 with JmxMetricExporterSpi

use of org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi in project ignite by apache.

the class GridTransactionsSystemUserTimeMetricsTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setGridLogger(testLog);
    boolean isClient = igniteInstanceName.contains(CLIENT);
    if (!isClient) {
        CacheConfiguration ccfg = new CacheConfiguration(CACHE_NAME);
        ccfg.setAtomicityMode(TRANSACTIONAL);
        ccfg.setBackups(1);
        ccfg.setWriteSynchronizationMode(FULL_SYNC);
        cfg.setCacheConfiguration(ccfg);
    }
    cfg.setMetricExporterSpi(new JmxMetricExporterSpi());
    cfg.setCommunicationSpi(new TestCommunicationSpi());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JmxMetricExporterSpi(org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi) CacheConfiguration(org.apache.ignite.configuration.CacheConfiguration)

Example 4 with JmxMetricExporterSpi

use of org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi in project ignite by apache.

the class JmxExporterSpiTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    cfg.setDataStorageConfiguration(new DataStorageConfiguration().setDefaultDataRegionConfiguration(new DataRegionConfiguration().setPersistenceEnabled(true)));
    JmxMetricExporterSpi jmxSpi = new JmxMetricExporterSpi();
    jmxSpi.setExportFilter(mgrp -> !mgrp.name().startsWith(FILTERED_PREFIX));
    cfg.setMetricExporterSpi(jmxSpi);
    return cfg;
}
Also used : DataStorageConfiguration(org.apache.ignite.configuration.DataStorageConfiguration) DataRegionConfiguration(org.apache.ignite.configuration.DataRegionConfiguration) IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JmxMetricExporterSpi(org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi)

Example 5 with JmxMetricExporterSpi

use of org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi in project ignite by apache.

the class GridServiceMetricsTest method getConfiguration.

/**
 * {@inheritDoc}
 */
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
    IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
    // JMX metrics exposition to see actual namings and placement of the metrics.
    cfg.setMetricExporterSpi(new JmxMetricExporterSpi());
    return cfg;
}
Also used : IgniteConfiguration(org.apache.ignite.configuration.IgniteConfiguration) JmxMetricExporterSpi(org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi)

Aggregations

IgniteConfiguration (org.apache.ignite.configuration.IgniteConfiguration)5 JmxMetricExporterSpi (org.apache.ignite.spi.metric.jmx.JmxMetricExporterSpi)5 Test (org.junit.jupiter.api.Test)2 Ignite (org.apache.ignite.Ignite)1 CacheConfiguration (org.apache.ignite.configuration.CacheConfiguration)1 DataRegionConfiguration (org.apache.ignite.configuration.DataRegionConfiguration)1 DataStorageConfiguration (org.apache.ignite.configuration.DataStorageConfiguration)1 SqlViewMetricExporterSpi (org.apache.ignite.spi.metric.sql.SqlViewMetricExporterSpi)1