com.netflix.servo.publish
Class JmxMetricPoller

java.lang.Object
  extended by com.netflix.servo.publish.JmxMetricPoller
All Implemented Interfaces:
MetricPoller

public final class JmxMetricPoller
extends java.lang.Object
implements MetricPoller

Generic poller for fetching simple data from JMX.


Constructor Summary
JmxMetricPoller(JmxConnector connector, java.util.List<javax.management.ObjectName> queries, MetricFilter counters)
          Creates a new instance that polls mbeans matching the provided object name patterns.
JmxMetricPoller(JmxConnector connector, javax.management.ObjectName query, MetricFilter counters)
          Creates a new instance that polls mbeans matching the provided object name pattern.
 
Method Summary
 java.util.List<Metric> poll(MetricFilter filter)
          Fetch the current values for a set of metrics that match the provided filter.
 java.util.List<Metric> poll(MetricFilter filter, boolean reset)
          Fetch the current values for a set of metrics that match the provided filter.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JmxMetricPoller

public JmxMetricPoller(JmxConnector connector,
                       javax.management.ObjectName query,
                       MetricFilter counters)
Creates a new instance that polls mbeans matching the provided object name pattern.

Parameters:
connector - used to get a connection to an MBeanServer
query - object name pattern for selecting mbeans
counters - metrics matching this filter will be treated as counters, all others will be gauges

JmxMetricPoller

public JmxMetricPoller(JmxConnector connector,
                       java.util.List<javax.management.ObjectName> queries,
                       MetricFilter counters)
Creates a new instance that polls mbeans matching the provided object name patterns.

Parameters:
connector - used to get a connection to an MBeanServer
queries - object name patterns for selecting mbeans
counters - metrics matching this filter will be treated as counters, all others will be gauges
Method Detail

poll

public java.util.List<Metric> poll(MetricFilter filter)
Fetch the current values for a set of metrics that match the provided filter. This method should be cheap, thread-safe, and interruptible so that it can be called frequently to collect metrics at a regular interval.

Specified by:
poll in interface MetricPoller
Parameters:
filter - retricts the set of metrics
Returns:
list of current metric values

poll

public java.util.List<Metric> poll(MetricFilter filter,
                                   boolean reset)
Fetch the current values for a set of metrics that match the provided filter. This method should be cheap, thread-safe, and interruptible so that it can be called frequently to collect metrics at a regular interval.

Specified by:
poll in interface MetricPoller
Parameters:
filter - retricts the set of metrics
reset - should this poller trigger a reset for ResettableMonitor
Returns:
list of current metric values