Package org.apache.solr.metrics
Class SolrMetricManager.RegexFilter
- java.lang.Object
-
- org.apache.solr.metrics.SolrMetricManager.RegexFilter
-
- All Implemented Interfaces:
com.codahale.metrics.MetricFilter
- Enclosing class:
- SolrMetricManager
public static class SolrMetricManager.RegexFilter extends Object implements com.codahale.metrics.MetricFilter
An implementation ofMetricFilter
that selects metrics with names that match regular expression patterns.
-
-
Constructor Summary
Constructors Constructor Description RegexFilter(String... patterns)
Create a filter that uses the provided prefix.RegexFilter(Collection<String> patterns)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Set<String>
getMatched()
Return the set of names that matched this filter.boolean
matches(String name, com.codahale.metrics.Metric metric)
void
reset()
Clear the set of names that matched.String
toString()
-
-
-
Constructor Detail
-
RegexFilter
public RegexFilter(String... patterns) throws PatternSyntaxException
Create a filter that uses the provided prefix.- Parameters:
patterns
- regex patterns to use, must not be null. If empty then any name will match, if not empty then match on any pattern will succeed (logical OR).- Throws:
PatternSyntaxException
-
RegexFilter
public RegexFilter(Collection<String> patterns) throws PatternSyntaxException
- Throws:
PatternSyntaxException
-
-
Method Detail
-
matches
public boolean matches(String name, com.codahale.metrics.Metric metric)
- Specified by:
matches
in interfacecom.codahale.metrics.MetricFilter
-
getMatched
public Set<String> getMatched()
Return the set of names that matched this filter.- Returns:
- matching names
-
reset
public void reset()
Clear the set of names that matched.
-
-