Segence / jmx-collector

Library to collect JMX metrics

Repository from Github https://github.comSegence/jmx-collectorRepository from Github https://github.comSegence/jmx-collector

JMX Collector

Workflow Status Coverage Status

A library to collect JMX metrics.

Usage

  1. Add the Segence OSS Releases Maven repo to your project, click here for instructions
  2. Import the artifact, click here for instructions
  3. Query JMX metrics by specifying some MBean names and attributes. Example:
import com.segence.commons.jmx.collector.JmxCollector

...

Map<ObjectName, Set<String>> mbeansAndAttributesToQuery = new HashMap<ObjectName, Set<String>>() {{
    try {
        put(
            new ObjectName("java.lang:type=OperatingSystem"),
            new HashSet<String>() {{
                add("Arch");
                add("AvailableProcessors");
            }}
        );
    } catch (MalformedObjectNameException e) {
        e.printStackTrace();
    }
}};

Set<MBeanMetricResult> results = JmxCollector.queryAsSet(mbeansAndAttributesToQuery);

About

Library to collect JMX metrics

License:Apache License 2.0


Languages

Language:Java 87.4%Language:Makefile 12.6%