Package org.apache.ignite.spi.metric
Interface ReadOnlyMetricRegistry
-
- All Known Subinterfaces:
MetricRegistry
public interface ReadOnlyMetricRegistry extends Iterable<Metric>
Read only metric registry.Java example
See the example below of how the internal metrics can be obtained through your application usingReadOnlyMetricRegistry
.JmxMetricExporterSpi jmxSpi = new JmxMetricExporterSpi(); Ignite ignite = Ignition.start(new IgniteConfiguration() .setDataStorageConfiguration(new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration() .setMaxSize(12_000_000))) .setIgniteInstanceName("jmxExampleInstanceName") .setMetricExporterSpi(jmxSpi)); ReadOnlyMetricRegistry ioReg = jmxSpi.getSpiContext().getOrCreateMetricRegistry("io.dataregion.default"); Set
listOfMetrics = StreamSupport.stream(ioReg.spliterator(), false) .map(Metric::name) .collect(toSet()); System.out.println("The list of available data region metrics: " + listOfMetrics); System.out.println("The 'default' data region MaxSize: " + ioReg.findMetric("MaxSize")); - See Also:
JmxMetricExporterSpi
,MetricExporterSpi
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description <M extends Metric>
MfindMetric(String name)
String
name()
-
Methods inherited from interface java.lang.Iterable
forEach, iterator, spliterator
-
-