com.netflix.servo.publish
Class BaseMetricPoller

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

public abstract class BaseMetricPoller
extends java.lang.Object
implements MetricPoller

Base class for simple pollers that do not benefit from filtering in advance. Sub-classes implement pollImpl(boolean) to return a list and all filtering will be taken care of by the provided implementation of poll(com.netflix.servo.publish.MetricFilter).


Field Summary
protected  org.slf4j.Logger logger
           
 
Constructor Summary
BaseMetricPoller()
           
 
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.
abstract  java.util.List<Metric> pollImpl(boolean reset)
          Return a list of all current metrics for this poller.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.slf4j.Logger logger
Constructor Detail

BaseMetricPoller

public BaseMetricPoller()
Method Detail

pollImpl

public abstract java.util.List<Metric> pollImpl(boolean reset)
Return a list of all current metrics for this poller.


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