com.netflix.servo.publish
Class PrefixMetricFilter

java.lang.Object
  extended by com.netflix.servo.publish.PrefixMetricFilter
All Implemented Interfaces:
MetricFilter

public final class PrefixMetricFilter
extends java.lang.Object
implements MetricFilter

Filter that checks for a prefix match on a given tag. This can be useful providing rules associated with the canonical class name.


Constructor Summary
PrefixMetricFilter(java.lang.String tagKey, MetricFilter root, java.util.NavigableMap<java.lang.String,MetricFilter> filters)
          Creates a new prefix filter.
 
Method Summary
 boolean matches(MonitorConfig config)
          Check if a metric with the provided configuration should be selected and sent to observers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PrefixMetricFilter

public PrefixMetricFilter(java.lang.String tagKey,
                          MetricFilter root,
                          java.util.NavigableMap<java.lang.String,MetricFilter> filters)
Creates a new prefix filter.

Parameters:
tagKey - the tag to perform matching on, if null the name will be checked
root - filter used if there are no prefix matches
filters - map of prefix to sub-filter. The filter associated with the longest matching prefix will be used.
Method Detail

matches

public boolean matches(MonitorConfig config)
Check if a metric with the provided configuration should be selected and sent to observers.

Specified by:
matches in interface MetricFilter
Parameters:
config - config settings associated with the metric
Returns:
true if the metric should be selected