de.otto.edison.metrics.configuration.MetricsJvmConfiguration Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of edison-metrics Show documentation
Show all versions of edison-metrics Show documentation
Status library of the edison-microservice project.
package de.otto.edison.metrics.configuration;
import com.codahale.metrics.MetricRegistry;
import com.codahale.metrics.jvm.FileDescriptorRatioGauge;
import com.codahale.metrics.jvm.GarbageCollectorMetricSet;
import com.codahale.metrics.jvm.MemoryUsageGaugeSet;
import com.ryantenney.metrics.spring.config.annotation.EnableMetrics;
import com.ryantenney.metrics.spring.config.annotation.MetricsConfigurerAdapter;
import org.springframework.context.annotation.Configuration;
@Configuration
@EnableMetrics
public class MetricsJvmConfiguration extends MetricsConfigurerAdapter {
@Override
public void configureReporters(final MetricRegistry metricRegistry) {
metricRegistry.register("gc", new GarbageCollectorMetricSet());
metricRegistry.register("memory", new MemoryUsageGaugeSet());
metricRegistry.register("filedescriptors.ratio", new FileDescriptorRatioGauge());
}
}