Search in sources :

Example 1 with SqlViewMetricExporterSpi

use of org.apache.ignite.spi.metric.sql.SqlViewMetricExporterSpi in project ignite by apache.

the class ConfiguringMetrics method sqlExporter.

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

Example 2 with SqlViewMetricExporterSpi

use of org.apache.ignite.spi.metric.sql.SqlViewMetricExporterSpi 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)

Aggregations

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