Package org.opensaml.core.metrics.impl

# Class FilteredMetricRegistry

java.lang.Object
com.codahale.metrics.MetricRegistry
org.opensaml.core.metrics.impl.FilteredMetricRegistry

All Implemented Interfaces:
  `com.codahale.metrics.Metric`, `com.codahale.metrics.MetricSet`

public class FilteredMetricRegistry extends com.codahale.metrics.MetricRegistry
`MetricRegistry` that returns a metric or a disabled wrapper for a metric based on a supplied `MetricFilter`.

If no filter is supplied, then all metrics are disabled.

Since:
  3.3.0

## Nested Class Summary

## Nested classes/interfaces inherited from class com.codahale.metrics.MetricRegistry

`com.codahale.metrics.MetricRegistry.MetricSupplier<T extends com.codahale.metrics.Metric>`

## Field Summary

Fields
Modifier and Type
Field
Description
`private final DisabledCounter`
`disabledCounter`
Dummy object.
`private final DisabledHistogram`
`disabledHistogram`
Dummy object.
`private final DisabledMeter`
`disabledMeter`
Dummy object.
`private final DisabledTimer`
`disabledTimer`
Dummy object.
`private com.codahale.metrics.MetricFilter`
`metricFilter`
Filter to apply.

## Constructor Summary

Constructors
Constructor
Description
`FilteredMetricRegistry()`
Constructor.

## Method Summary

Modifier and Type
Method
Description
`com.codahale.metrics.Counter`
`counter(String name)`
`com.codahale.metrics.Histogram`
`histogram(String name)`
`com.codahale.metrics.Meter`
`meter(String name)`
`void`
`registerMultiple(Collection<com.codahale.metrics.MetricSet> metricSets)`
Given multiple metric sets, registers them.
`void`
`setMetricFilter(com.codahale.metrics.MetricFilter filter)`
Set the filter to use.
`com.codahale.metrics.Timer`
`timer(String name)`

### Methods inherited from class com.codahale.metrics.MetricRegistry

`addListener, buildMap, counter, gauge, gauge, getCounters, getCounters, getGauges, getGauges, getHistograms, getHistograms, getMeters, getMeters, getMetrics, getNames, getTimers, getTimers, histogram, meter, name, name, register, registerAll, registerAll, registerGauge, remove, removeListener, removeMatching, timer`

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

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

## Field Details

### metricFilter

@Nullable private com.codahale.metrics.MetricFilter metricFilter
Filter to apply.

### disabledCounter

@Nonnull private final DisabledCounter disabledCounter
Dummy object.

### disabledHistogram

@Nonnull private final DisabledHistogram disabledHistogram
Dummy object.

### disabledMeter

@Nonnull private final DisabledMeter disabledMeter
Dummy object.

### disabledTimer

@Nonnull private final DisabledTimer disabledTimer
Dummy object.

## Constructor Details

### FilteredMetricRegistry

public FilteredMetricRegistry()
Constructor.

## Method Details

### setMetricFilter

public void setMetricFilter(@Nullable com.codahale.metrics.MetricFilter filter)
Set the filter to use.

Parameters:
  `filter` - filter to apply, if any

### counter

public com.codahale.metrics.Counter counter(String name)

Overrides:
  `counter` in class `com.codahale.metrics.MetricRegistry`

### histogram

public com.codahale.metrics.Histogram histogram(String name)

Overrides:
  `histogram` in class `com.codahale.metrics.MetricRegistry`

### meter

public com.codahale.metrics.Meter meter(String name)

Overrides:
  `meter` in class `com.codahale.metrics.MetricRegistry`

### timer

public com.codahale.metrics.Timer timer(String name)

Overrides:
  `timer` in class `com.codahale.metrics.MetricRegistry`

### registerMultiple

public void registerMultiple(@Nonnull Collection<com.codahale.metrics.MetricSet> metricSets) throws IllegalArgumentException
Given multiple metric sets, registers them.

Parameters:
  `metricSets` - any number of metric sets
Throws:
  `IllegalArgumentException` - if any of the names are already registered