Liking cljdoc? Tell your friends :D

jmx-utils Clojars Project

This library will help you in getting all the registered metrics in the JMX MbeanServer.

If you are looking for getting all the metrics from JMX MbeanServer and do some stuffs with that, like writing a metric reporter, then this is the library you are looking for.

Maven Dependency

Use the following repository

    <name>Clojars repository</name>

Use the following maven dependency


How to Use ?

First you need to create a class by implementing JmxMetricsListener interface.

    import com.geekvivek.jmx.utils.JmxMetric;
    import com.geekvivek.jmx.utils.interfaces.JmxMetricsListener;

    class MetricReporter1 implements JmxMetricsListener {
        public void metricChange(JmxMetric metric){ /*do stuffs on receiving new metrics*/ }
        public void metricRemoval(JmxMetric metric){ /* do stuffs when a metrics is removed from JMX */}
        public void close(){ /* do stuffs when application is closing */}

Now create an instance of MetricReporter1 and pass it to JmxMetricProviderService and start the JmxMetricProviderService

    import com.geekvivek.jmx.utils.service.JmxMetricProviderService;
    new JmxMetricProviderService(Collections.singletonList(
        new MetricReporter1()
    )).start(10, 60, TimeUnit.SECONDS);

Note : Check the javadoc of classes for more info.

Can you improve this documentation?Edit on GitHub

cljdoc is a website building & hosting documentation for Clojure/Script libraries

× close