com.netflix.servo.publish
Class RegexMetricFilter

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

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

Filter that checks if a tag value matches a regular expression.


Constructor Summary
RegexMetricFilter(java.lang.String tagKey, java.util.regex.Pattern pattern, boolean matchIfMissingTag, boolean invert)
          Creates a new regex 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

RegexMetricFilter

public RegexMetricFilter(java.lang.String tagKey,
                         java.util.regex.Pattern pattern,
                         boolean matchIfMissingTag,
                         boolean invert)
Creates a new regex filter.

Parameters:
tagKey - tag to check against the pattern
pattern - pattern to check
matchIfMissingTag - should metrics without the specified tag match?
invert - should the match be inverted?
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