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

io.rtr.alchemy.service.metrics.JmxMetricsManaged Maven / Gradle / Ivy

The newest version!
package io.rtr.alchemy.service.metrics;

import com.codahale.metrics.jmx.JmxReporter;

import io.dropwizard.lifecycle.Managed;
import io.dropwizard.setup.Environment;

/** Enables logging of metrics to JMX */
public class JmxMetricsManaged implements Managed {
    private final JmxReporter reporter;

    public JmxMetricsManaged(Environment environment) {
        reporter = JmxReporter.forRegistry(environment.metrics()).build();
    }

    @Override
    public void start() throws Exception {
        reporter.start();
    }

    @Override
    public void stop() throws Exception {
        reporter.stop();
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy