All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.otto.edison.metrics.configuration.MetricsJvmConfiguration Maven / Gradle / Ivy

There is a newer version: 0.82.2
Show newest version
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());
    }

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy