public class LoggerDrivenMetricFilter extends Object implements com.codahale.metrics.MetricFilter
MetricFilter that evaluates a metric by prefixing the name and then evaluating
whether the corresponding logging category is enabled at a level corresponding to a map value
or at INFO level.| Modifier and Type | Class and Description |
|---|---|
static class |
LoggerDrivenMetricFilter.Level
Filtering level, corresponding to available logging levels.
|
| Modifier and Type | Field and Description |
|---|---|
private Map<String,LoggerDrivenMetricFilter.Level> |
levelMap
Map of metrics to logging levels.
|
private String |
loggerPrefix
Prefix to prepend to metric name.
|
| Constructor and Description |
|---|
LoggerDrivenMetricFilter(String prefix)
Constructor.
|
LoggerDrivenMetricFilter(String prefix,
Map<String,LoggerDrivenMetricFilter.Level> map)
Constructor.
|
@Nonnull @NonnullElements private final Map<String,LoggerDrivenMetricFilter.Level> levelMap
public LoggerDrivenMetricFilter(@Nonnull@NotEmpty@ParameterName(name="prefix") String prefix)
prefix - prefix to attach to metric name before evaluatingpublic LoggerDrivenMetricFilter(@Nonnull@NotEmpty@ParameterName(name="prefix") String prefix, @Nullable@NonnullElements@ParameterName(name="map") Map<String,LoggerDrivenMetricFilter.Level> map)
prefix - prefix to attach to metric name before evaluatingmap - map of metric names to logging levelspublic boolean matches(String name, com.codahale.metrics.Metric metric)
matches in interface com.codahale.metrics.MetricFilterCopyright © 1999–2019 Shibboleth Consortium. All rights reserved.