public final class NoopMetricRegistry extends MetricRegistry
MetricRegistry.MetricSupplier<T extends Metric>| Constructor and Description |
|---|
NoopMetricRegistry() |
| Modifier and Type | Method and Description |
|---|---|
void |
addListener(MetricRegistryListener listener)
Adds a
MetricRegistryListener to a collection of listeners that will be notified on
metric creation. |
protected ConcurrentMap<String,Metric> |
buildMap()
Creates a new
ConcurrentMap implementation for use inside the registry. |
Counter |
counter(String name)
|
Counter |
counter(String name,
MetricRegistry.MetricSupplier<Counter> supplier)
|
Gauge |
gauge(String name,
MetricRegistry.MetricSupplier<Gauge> supplier)
|
SortedMap<String,Counter> |
getCounters()
Returns a map of all the counters in the registry and their names.
|
SortedMap<String,Counter> |
getCounters(MetricFilter filter)
Returns a map of all the counters in the registry and their names which match the given
filter.
|
SortedMap<String,Gauge> |
getGauges()
Returns a map of all the gauges in the registry and their names.
|
SortedMap<String,Gauge> |
getGauges(MetricFilter filter)
Returns a map of all the gauges in the registry and their names which match the given filter.
|
SortedMap<String,Histogram> |
getHistograms()
Returns a map of all the histograms in the registry and their names.
|
SortedMap<String,Histogram> |
getHistograms(MetricFilter filter)
Returns a map of all the histograms in the registry and their names which match the given
filter.
|
SortedMap<String,Meter> |
getMeters()
Returns a map of all the meters in the registry and their names.
|
SortedMap<String,Meter> |
getMeters(MetricFilter filter)
Returns a map of all the meters in the registry and their names which match the given filter.
|
Map<String,Metric> |
getMetrics()
A map of metric names to metrics.
|
SortedSet<String> |
getNames()
Returns a set of the names of all the metrics in the registry.
|
SortedMap<String,Timer> |
getTimers()
Returns a map of all the timers in the registry and their names.
|
SortedMap<String,Timer> |
getTimers(MetricFilter filter)
Returns a map of all the timers in the registry and their names which match the given filter.
|
Histogram |
histogram(String name)
|
Histogram |
histogram(String name,
MetricRegistry.MetricSupplier<Histogram> supplier)
|
Meter |
meter(String name)
|
Meter |
meter(String name,
MetricRegistry.MetricSupplier<Meter> supplier)
|
<T extends Metric> |
register(String name,
T metric)
Given a
Metric, registers it under the given name. |
void |
registerAll(MetricSet metrics)
Given a metric set, registers them.
|
void |
registerAll(String prefix,
MetricSet metrics)
Given a metric set, registers them with the given prefix prepended to their names.
|
boolean |
remove(String name)
Removes the metric with the given name.
|
void |
removeListener(MetricRegistryListener listener)
Removes a
MetricRegistryListener from this registry's collection of listeners. |
void |
removeMatching(MetricFilter filter)
Removes all metrics which match the given filter.
|
Timer |
timer(String name)
|
Timer |
timer(String name,
MetricRegistry.MetricSupplier<Timer> supplier)
|
name, nameprotected ConcurrentMap<String,Metric> buildMap()
ConcurrentMap implementation for use inside the registry. Override this
to create a MetricRegistry with space- or time-bounded metric lifecycles, for
example.buildMap in class MetricRegistryConcurrentMappublic <T extends Metric> T register(String name, T metric) throws IllegalArgumentException
Metric, registers it under the given name.register in class MetricRegistryT - the type of the metricname - the name of the metricmetric - the metricmetricIllegalArgumentException - if the name is already registered or metric variable is nullpublic void registerAll(MetricSet metrics) throws IllegalArgumentException
registerAll in class MetricRegistrymetrics - a set of metricsIllegalArgumentException - if any of the names are already registeredpublic Counter counter(String name)
Counter registered under this name; or create and register
a new Counter if none is registered.counter in class MetricRegistryname - the name of the metricCounterpublic Counter counter(String name, MetricRegistry.MetricSupplier<Counter> supplier)
Counter registered under this name; or create and register
a new Counter using the provided MetricSupplier if none is registered.counter in class MetricRegistryname - the name of the metricsupplier - a MetricSupplier that can be used to manufacture a counter.Counterpublic Histogram histogram(String name)
Histogram registered under this name; or create and register
a new Histogram if none is registered.histogram in class MetricRegistryname - the name of the metricHistogrampublic Histogram histogram(String name, MetricRegistry.MetricSupplier<Histogram> supplier)
Histogram registered under this name; or create and register
a new Histogram using the provided MetricSupplier if none is registered.histogram in class MetricRegistryname - the name of the metricsupplier - a MetricSupplier that can be used to manufacture a histogramHistogrampublic Meter meter(String name)
Meter registered under this name; or create and register
a new Meter if none is registered.meter in class MetricRegistryname - the name of the metricMeterpublic Meter meter(String name, MetricRegistry.MetricSupplier<Meter> supplier)
Meter registered under this name; or create and register
a new Meter using the provided MetricSupplier if none is registered.meter in class MetricRegistryname - the name of the metricsupplier - a MetricSupplier that can be used to manufacture a MeterMeterpublic Timer timer(String name)
Timer registered under this name; or create and register
a new Timer if none is registered.timer in class MetricRegistryname - the name of the metricTimerpublic Timer timer(String name, MetricRegistry.MetricSupplier<Timer> supplier)
Timer registered under this name; or create and register
a new Timer using the provided MetricSupplier if none is registered.timer in class MetricRegistryname - the name of the metricsupplier - a MetricSupplier that can be used to manufacture a TimerTimerpublic Gauge gauge(String name, MetricRegistry.MetricSupplier<Gauge> supplier)
Gauge registered under this name; or create and register
a new Gauge using the provided MetricSupplier if none is registered.gauge in class MetricRegistryname - the name of the metricsupplier - a MetricSupplier that can be used to manufacture a GaugeGaugepublic boolean remove(String name)
remove in class MetricRegistryname - the name of the metricpublic void removeMatching(MetricFilter filter)
removeMatching in class MetricRegistryfilter - a filterpublic void addListener(MetricRegistryListener listener)
MetricRegistryListener to a collection of listeners that will be notified on
metric creation. Listeners will be notified in the order in which they are added.
N.B.: The listener will be notified of all existing metrics when it first registers.
addListener in class MetricRegistrylistener - the listener that will be notifiedpublic void removeListener(MetricRegistryListener listener)
MetricRegistryListener from this registry's collection of listeners.removeListener in class MetricRegistrylistener - the listener that will be removedpublic SortedSet<String> getNames()
getNames in class MetricRegistrypublic SortedMap<String,Gauge> getGauges()
getGauges in class MetricRegistrypublic SortedMap<String,Gauge> getGauges(MetricFilter filter)
getGauges in class MetricRegistryfilter - the metric filter to matchpublic SortedMap<String,Counter> getCounters()
getCounters in class MetricRegistrypublic SortedMap<String,Counter> getCounters(MetricFilter filter)
getCounters in class MetricRegistryfilter - the metric filter to matchpublic SortedMap<String,Histogram> getHistograms()
getHistograms in class MetricRegistrypublic SortedMap<String,Histogram> getHistograms(MetricFilter filter)
getHistograms in class MetricRegistryfilter - the metric filter to matchpublic SortedMap<String,Meter> getMeters()
getMeters in class MetricRegistrypublic SortedMap<String,Meter> getMeters(MetricFilter filter)
getMeters in class MetricRegistryfilter - the metric filter to matchpublic SortedMap<String,Timer> getTimers()
getTimers in class MetricRegistrypublic SortedMap<String,Timer> getTimers(MetricFilter filter)
getTimers in class MetricRegistryfilter - the metric filter to matchpublic void registerAll(String prefix, MetricSet metrics) throws IllegalArgumentException
registerAll in class MetricRegistryprefix - a name prefixmetrics - a set of metricsIllegalArgumentException - if any of the names are already registeredpublic Map<String,Metric> getMetrics()
getMetrics in interface MetricSetgetMetrics in class MetricRegistryCopyright © 2011. All rights reserved.