public class MetricRegistryImpl extends MetricRegistry
| 构造器和说明 |
|---|
MetricRegistryImpl()
Creates a new
MetricRegistry. |
MetricRegistryImpl(int maxMetricCount) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
addListener(MetricRegistryListener listener)
Adds a
MetricRegistryListener to a collection of listeners that will be notified on
metric creation. |
ClusterHistogram |
clusterHistogram(MetricName name,
long[] buckets) |
Compass |
compass(MetricName name)
|
Compass |
compass(MetricName name,
ReservoirType type)
Create a compass with given name, and reservoir type
|
Compass |
compass(String name) |
Counter |
counter(MetricName name)
|
Counter |
counter(String name) |
FastCompass |
fastCompass(MetricName name) |
SortedMap<MetricName,ClusterHistogram> |
getClusterHistograms(MetricFilter filter) |
SortedMap<MetricName,Compass> |
getCompasses() |
SortedMap<MetricName,Compass> |
getCompasses(MetricFilter filter) |
SortedMap<MetricName,Counter> |
getCounters()
Returns a map of all the counters in the registry and their names.
|
SortedMap<MetricName,Counter> |
getCounters(MetricFilter filter)
Returns a map of all the counters in the registry and their names which match the given
filter.
|
SortedMap<MetricName,FastCompass> |
getFastCompasses() |
SortedMap<MetricName,FastCompass> |
getFastCompasses(MetricFilter filter) |
SortedMap<MetricName,Gauge> |
getGauges()
Returns a map of all the gauges in the registry and their names.
|
SortedMap<MetricName,Gauge> |
getGauges(MetricFilter filter)
Returns a map of all the gauges in the registry and their names which match the given filter.
|
SortedMap<MetricName,Histogram> |
getHistograms()
Returns a map of all the histograms in the registry and their names.
|
SortedMap<MetricName,Histogram> |
getHistograms(MetricFilter filter)
Returns a map of all the histograms in the registry and their names which match the given
filter.
|
SortedMap<MetricName,Meter> |
getMeters()
Returns a map of all the meters in the registry and their names.
|
SortedMap<MetricName,Meter> |
getMeters(MetricFilter filter)
Returns a map of all the meters in the registry and their names which match the given filter.
|
Map<MetricName,Metric> |
getMetrics() |
SortedMap<MetricName,Metric> |
getMetrics(MetricFilter filter) |
SortedSet<MetricName> |
getNames()
Returns a set of the names of all the metrics in the registry.
|
SortedMap<MetricName,Timer> |
getTimers()
Returns a map of all the timers in the registry and their names.
|
SortedMap<MetricName,Timer> |
getTimers(MetricFilter filter)
Returns a map of all the timers in the registry and their names which match the given filter.
|
Histogram |
histogram(MetricName name)
|
Histogram |
histogram(MetricName name,
ReservoirType type)
Create a histogram with given name, and reservoir type
|
Histogram |
histogram(String name) |
long |
lastUpdateTime()
This is an expensive method that will traverse all the metrics, it should be used under a low frequency.
|
Meter |
meter(MetricName name)
|
Meter |
meter(String name) |
<T extends Metric> |
register(MetricName name,
T metric)
Given a
Metric, registers it under the given name. |
<T extends Metric> |
register(String name,
T metric) |
void |
registerAll(MetricSet metrics)
Given a metric set, registers them.
|
boolean |
remove(MetricName 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(MetricName name)
|
Timer |
timer(MetricName name,
ReservoirType type)
Create a timer with given name, and reservoir type
|
Timer |
timer(String name) |
name, namepublic MetricRegistryImpl()
MetricRegistry.public MetricRegistryImpl(int maxMetricCount)
public <T extends Metric> T register(String name, T metric) throws IllegalArgumentException
register 在类中 MetricRegistryIllegalArgumentExceptionregister(MetricName, Metric)public <T extends Metric> T register(MetricName name, T metric) throws IllegalArgumentException
Metric, registers it under the given name.register 在类中 MetricRegistryT - the type of the metricname - the name of the metricmetric - the metricmetricIllegalArgumentException - if the name is already registeredpublic void registerAll(MetricSet metrics) throws IllegalArgumentException
registerAll 在类中 MetricRegistrymetrics - a set of metricsIllegalArgumentException - if any of the names are already registeredpublic Counter counter(String name)
counter 在类中 MetricRegistrycounter(MetricName)public Counter counter(MetricName name)
Counter registered under this name; or create and register
a new Counter if none is registered.counter 在类中 MetricRegistryname - the name of the metricCounterpublic Histogram histogram(String name)
histogram 在类中 MetricRegistryhistogram(MetricName)public Histogram histogram(MetricName name)
Histogram registered under this name; or create and register
a new Histogram if none is registered.histogram 在类中 MetricRegistryname - the name of the metricHistogrampublic Histogram histogram(MetricName name, ReservoirType type)
histogram 在类中 MetricRegistryname - the name of the metrictype - the type of reservoirpublic Meter meter(String name)
meter 在类中 MetricRegistrymeter(MetricName)public Meter meter(MetricName name)
Meter registered under this name; or create and register
a new Meter if none is registered.meter 在类中 MetricRegistryname - the name of the metricMeterpublic Timer timer(String name)
timer 在类中 MetricRegistrytimer(MetricName)public Timer timer(MetricName name)
Timer registered under this name; or create and register
a new Timer if none is registered.timer 在类中 MetricRegistryname - the name of the metricTimerpublic Timer timer(MetricName name, ReservoirType type)
timer 在类中 MetricRegistryname - the name of the metrictype - the type of reservoirpublic Compass compass(MetricName name)
Compass registered under this name; or create and register
a new Timer if none is registered.compass 在类中 MetricRegistryname - the name of the metricCompasspublic Compass compass(MetricName name, ReservoirType type)
compass 在类中 MetricRegistryname - the name of the metrictype - the type of reservoirpublic Compass compass(String name)
compass 在类中 MetricRegistrycompass(MetricName)public FastCompass fastCompass(MetricName name)
fastCompass 在类中 MetricRegistrypublic ClusterHistogram clusterHistogram(MetricName name, long[] buckets)
clusterHistogram 在类中 MetricRegistrypublic boolean remove(MetricName name)
remove 在类中 MetricRegistryname - the name of the metricpublic void removeMatching(MetricFilter filter)
removeMatching 在类中 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 在类中 MetricRegistrylistener - the listener that will be notifiedpublic void removeListener(MetricRegistryListener listener)
MetricRegistryListener from this registry's collection of listeners.removeListener 在类中 MetricRegistrylistener - the listener that will be removedpublic SortedSet<MetricName> getNames()
getNames 在类中 MetricRegistrypublic SortedMap<MetricName,Gauge> getGauges()
getGauges 在类中 MetricRegistrypublic SortedMap<MetricName,Gauge> getGauges(MetricFilter filter)
getGauges 在类中 MetricRegistryfilter - the metric filter to matchpublic SortedMap<MetricName,Counter> getCounters()
getCounters 在类中 MetricRegistrypublic SortedMap<MetricName,Counter> getCounters(MetricFilter filter)
getCounters 在类中 MetricRegistryfilter - the metric filter to matchpublic SortedMap<MetricName,Histogram> getHistograms()
getHistograms 在类中 MetricRegistrypublic SortedMap<MetricName,Histogram> getHistograms(MetricFilter filter)
getHistograms 在类中 MetricRegistryfilter - the metric filter to matchpublic SortedMap<MetricName,Meter> getMeters()
getMeters 在类中 MetricRegistrypublic SortedMap<MetricName,Meter> getMeters(MetricFilter filter)
getMeters 在类中 MetricRegistryfilter - the metric filter to matchpublic SortedMap<MetricName,Timer> getTimers()
getTimers 在类中 MetricRegistrypublic SortedMap<MetricName,Timer> getTimers(MetricFilter filter)
getTimers 在类中 MetricRegistryfilter - the metric filter to matchpublic SortedMap<MetricName,Compass> getCompasses(MetricFilter filter)
getCompasses 在类中 MetricRegistrypublic SortedMap<MetricName,Compass> getCompasses()
getCompasses 在类中 MetricRegistrypublic SortedMap<MetricName,FastCompass> getFastCompasses()
getFastCompasses 在类中 MetricRegistrypublic SortedMap<MetricName,FastCompass> getFastCompasses(MetricFilter filter)
getFastCompasses 在类中 MetricRegistrypublic SortedMap<MetricName,ClusterHistogram> getClusterHistograms(MetricFilter filter)
getClusterHistograms 在类中 MetricRegistrypublic SortedMap<MetricName,Metric> getMetrics(MetricFilter filter)
getMetrics 在类中 MetricRegistrypublic long lastUpdateTime()
public Map<MetricName,Metric> getMetrics()
Copyright © 2019. All rights reserved.