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

com.palominolabs.metrics.guice.JmxReporterProvider Maven / Gradle / Ivy

There is a newer version: 5.0.1
Show newest version
package com.palominolabs.metrics.guice;

import com.codahale.metrics.JmxReporter;
import com.codahale.metrics.MetricRegistry;
import com.google.inject.Inject;
import com.google.inject.Provider;
import com.google.inject.Singleton;

@Singleton
public class JmxReporterProvider implements Provider {
    private final MetricRegistry metricRegistry;

    @Inject
    public JmxReporterProvider(MetricRegistry metricRegistry) {
        this.metricRegistry = metricRegistry;
    }

    @Override
    public JmxReporter get() {
        final JmxReporter reporter = JmxReporter.forRegistry(metricRegistry).build();
        reporter.start();
        return reporter;
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy