com.netflix.servo.publish
Class CompositeMetricPoller

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

public class CompositeMetricPoller
extends java.lang.Object
implements MetricPoller

Combines results from a list of metric pollers. This clas


Constructor Summary
CompositeMetricPoller(java.util.Map<java.lang.String,MetricPoller> pollers, java.util.concurrent.ExecutorService executor, long timeout)
          Creates a new instance for a set of pollers.
 
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

CompositeMetricPoller

public CompositeMetricPoller(java.util.Map<java.lang.String,MetricPoller> pollers,
                             java.util.concurrent.ExecutorService executor,
                             long timeout)
Creates a new instance for a set of pollers.

Parameters:
pollers - a set of pollers to collect data from, the map key for a poller is used as a name identify a particular poller for logging and error messages
executor - an executor to use for executing the poll methods
timeout - timeout in milliseconds used when getting the value from the future
Method Detail

poll

public final 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 final 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