use of org.apache.ignite.internal.processors.metric.PushMetricsExporterAdapter in project ignite by apache.
the class ReadMetricsOnNodeStartupTest method getConfiguration.
/**
* {@inheritDoc}
*/
@Override
protected IgniteConfiguration getConfiguration(String igniteInstanceName) throws Exception {
IgniteConfiguration cfg = super.getConfiguration(igniteInstanceName);
cfg.setGridLogger(listeningLog);
PushMetricsExporterAdapter adapter = new PushMetricsExporterAdapter() {
@Override
public void export() {
try {
mreg.forEach(metrics -> {
// Read metric value.
metrics.forEach(Metric::getAsString);
});
} catch (Throwable e) {
log.error("Exception on metric export", e);
throw e;
}
exportLatch.countDown();
}
};
adapter.setPeriod(EXPORT_TIMEOUT);
cfg.setMetricExporterSpi(adapter);
return cfg;
}
Aggregations