Package org.opensaml.core.metrics

# Class LoggerDrivenMetricFilter

java.lang.Object
org.opensaml.core.metrics.LoggerDrivenMetricFilter

All Implemented Interfaces:
  `com.codahale.metrics.MetricFilter`

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.

Since:
  3.3.0

## Nested Class Summary

Nested Classes
Modifier and Type
Class
Description
`static enum`
`LoggerDrivenMetricFilter.Level`
Filtering level, corresponding to available logging levels.

## Field Summary

Fields
Modifier and Type
Field
Description
`private final Map<String,LoggerDrivenMetricFilter.Level>`
`levelMap`
Map of metrics to logging levels.
`private final String`
`loggerPrefix`
Prefix to prepend to metric name.

### Fields inherited from interface com.codahale.metrics.MetricFilter

`ALL`

## Constructor Summary

Constructors
Constructor
Description
`LoggerDrivenMetricFilter(String prefix)`
Constructor.
`LoggerDrivenMetricFilter(String prefix, Map<String,LoggerDrivenMetricFilter.Level> map)`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`boolean`
`matches(String name, com.codahale.metrics.Metric metric)`

### Methods inherited from class java.lang.Object

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

## Field Details

### loggerPrefix

@Nonnull @NotEmpty private final String loggerPrefix
Prefix to prepend to metric name.

### levelMap

@Nonnull private final Map<String,LoggerDrivenMetricFilter.Level> levelMap
Map of metrics to logging levels.

## Constructor Details

### LoggerDrivenMetricFilter

public LoggerDrivenMetricFilter(@Nonnull @NotEmpty @ParameterName(name="prefix") String prefix)
Constructor.

Parameters:
  `prefix` - prefix to attach to metric name before evaluating

### LoggerDrivenMetricFilter

public LoggerDrivenMetricFilter(@Nonnull @NotEmpty @ParameterName(name="prefix") String prefix, @Nullable @ParameterName(name="map") Map<String,LoggerDrivenMetricFilter.Level> map)
Constructor.

Parameters:
  `prefix` - prefix to attach to metric name before evaluating
  `map` - map of metric names to logging levels

## Method Details

### matches

public boolean matches(String name, com.codahale.metrics.Metric metric)

Specified by:
  `matches` in interface `com.codahale.metrics.MetricFilter`