| 构造器和说明 |
|---|
MetricRegistry() |
| 限定符和类型 | 方法和说明 |
|---|---|
abstract void |
addListener(MetricRegistryListener listener)
Adds a
MetricRegistryListener to a collection of listeners that will be notified on
metric creation. |
abstract ClusterHistogram |
clusterHistogram(MetricName name,
long[] buckets)
Creates a new
ClusterHistogram and registers it under the given name. |
abstract Compass |
compass(MetricName name)
|
abstract Compass |
compass(MetricName name,
ReservoirType type)
Create a compass with given name, and reservoir type
|
abstract Compass |
compass(String name)
Creates a new
Compass and registers it under the given name. |
abstract Counter |
counter(MetricName name)
|
abstract Counter |
counter(String name)
Creates a new
Counter and registers it under the given name. |
abstract FastCompass |
fastCompass(MetricName name)
Create a FastCompass with given name
|
abstract SortedMap<MetricName,ClusterHistogram> |
getClusterHistograms(MetricFilter filter)
Returns a map of all the
ClusterHistogram in the registry and their names which match the given filter. |
abstract SortedMap<MetricName,Compass> |
getCompasses()
Returns a map of all the compasses in the registry and their names.
|
abstract SortedMap<MetricName,Compass> |
getCompasses(MetricFilter filter)
Returns a map of all the compasses in the registry and their names which match the given filter.
|
abstract SortedMap<MetricName,Counter> |
getCounters()
Returns a map of all the counters in the registry and their names.
|
abstract SortedMap<MetricName,Counter> |
getCounters(MetricFilter filter)
Returns a map of all the counters in the registry and their names which match the given
filter.
|
abstract SortedMap<MetricName,FastCompass> |
getFastCompasses()
Returns a map of all the compasses in the registry and their names.
|
abstract SortedMap<MetricName,FastCompass> |
getFastCompasses(MetricFilter filter)
Returns a map of all the compasses in the registry and their names which match the given filter.
|
abstract SortedMap<MetricName,Gauge> |
getGauges()
Returns a map of all the gauges in the registry and their names.
|
abstract SortedMap<MetricName,Gauge> |
getGauges(MetricFilter filter)
Returns a map of all the gauges in the registry and their names which match the given filter.
|
abstract SortedMap<MetricName,Histogram> |
getHistograms()
Returns a map of all the histograms in the registry and their names.
|
abstract SortedMap<MetricName,Histogram> |
getHistograms(MetricFilter filter)
Returns a map of all the histograms in the registry and their names which match the given
filter.
|
abstract SortedMap<MetricName,Meter> |
getMeters()
Returns a map of all the meters in the registry and their names.
|
abstract SortedMap<MetricName,Meter> |
getMeters(MetricFilter filter)
Returns a map of all the meters in the registry and their names which match the given filter.
|
abstract SortedMap<MetricName,Metric> |
getMetrics(MetricFilter filter)
Returns a map of all the metrics in the registry and their names which match the given filter
|
abstract SortedSet<MetricName> |
getNames()
Returns a set of the names of all the metrics in the registry.
|
abstract SortedMap<MetricName,Timer> |
getTimers()
Returns a map of all the timers in the registry and their names.
|
abstract SortedMap<MetricName,Timer> |
getTimers(MetricFilter filter)
Returns a map of all the timers in the registry and their names which match the given filter.
|
abstract Histogram |
histogram(MetricName name)
|
abstract Histogram |
histogram(MetricName name,
ReservoirType type)
Create a histogram with given name, and reservoir type
|
abstract Histogram |
histogram(String name)
Creates a new
Histogram and registers it under the given name. |
abstract Meter |
meter(MetricName name)
|
abstract Meter |
meter(String name)
Creates a new
Meter and registers it under the given name. |
static MetricName |
name(Class<?> klass,
String... names) |
static MetricName |
name(String name,
String... names)
Shorthand method for backwards compatibility in creating metric names.
|
abstract <T extends Metric> |
register(MetricName name,
T metric)
Given a
Metric, registers it under the given name. |
abstract <T extends Metric> |
register(String name,
T metric)
Given a
Metric, registers it under the given name. |
abstract void |
registerAll(MetricSet metrics)
Given a metric set, registers them.
|
abstract boolean |
remove(MetricName name)
Removes the metric with the given name.
|
abstract void |
removeListener(MetricRegistryListener listener)
Removes a
MetricRegistryListener from this registry's collection of listeners. |
abstract void |
removeMatching(MetricFilter filter)
Removes all metrics which match the given filter.
|
abstract Timer |
timer(MetricName name)
|
abstract Timer |
timer(MetricName name,
ReservoirType type)
Create a timer with given name, and reservoir type
|
abstract Timer |
timer(String name)
Creates a new
Timer and registers it under the given name. |
getMetricslastUpdateTimepublic static MetricName name(Class<?> klass, String... names)
name(String, String...)public static MetricName name(String name, String... names)
MetricName.build(String...) for its
heavy lifting.name - The first element of the namenames - The remaining elements of the nameMetricName.build(String...)public abstract <T extends Metric> T register(String name, T metric) throws IllegalArgumentException
Metric, registers it under the given name.T - the type of the metricname - the name of the metricmetric - the metricmetricIllegalArgumentException - if the name is already registeredpublic abstract <T extends Metric> T register(MetricName name, T metric) throws IllegalArgumentException
Metric, registers it under the given name.T - the type of the metricname - the name of the metricmetric - the metricmetricIllegalArgumentException - if the name is already registeredpublic abstract void registerAll(MetricSet metrics) throws IllegalArgumentException
metrics - a set of metricsIllegalArgumentException - if any of the names are already registeredpublic abstract Counter counter(String name)
Counter and registers it under the given name.name - the name of the metricCounterpublic abstract Counter counter(MetricName name)
Counter registered under this name; or create and register
a new Counter if none is registered.name - the name of the metricCounterpublic abstract Histogram histogram(MetricName name)
Histogram registered under this name; or create and register
a new Histogram if none is registered.name - the name of the metricHistogrampublic abstract Histogram histogram(MetricName name, ReservoirType type)
name - the name of the metrictype - the type of reservoirpublic abstract Histogram histogram(String name)
Histogram and registers it under the given name.name - the name of the metricHistogrampublic abstract Meter meter(MetricName name)
Meter registered under this name; or create and register
a new Meter if none is registered.name - the name of the metricMeterpublic abstract Meter meter(String name)
Meter and registers it under the given name.name - the name of the metricMeterpublic abstract Timer timer(MetricName name)
Timer registered under this name; or create and register
a new Timer if none is registered.name - the name of the metricTimerpublic abstract Timer timer(MetricName name, ReservoirType type)
name - the name of the metrictype - the type of reservoirpublic abstract Timer timer(String name)
Timer and registers it under the given name.name - the name of the metricTimerpublic abstract Compass compass(MetricName name)
Compass registered under this name; or create and register
a new Timer if none is registered.name - the name of the metricCompasspublic abstract Compass compass(MetricName name, ReservoirType type)
name - the name of the metrictype - the type of reservoirpublic abstract FastCompass fastCompass(MetricName name)
name - the name of the metricpublic abstract Compass compass(String name)
Compass and registers it under the given name.name - the name of the metricCompasspublic abstract ClusterHistogram clusterHistogram(MetricName name, long[] buckets)
ClusterHistogram and registers it under the given name.name - the name of the metricbuckets - the array of long values for bucketsClusterHistogrampublic abstract boolean remove(MetricName name)
name - the name of the metricpublic abstract void removeMatching(MetricFilter filter)
filter - a filterpublic abstract 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.listener - the listener that will be notifiedpublic abstract void removeListener(MetricRegistryListener listener)
MetricRegistryListener from this registry's collection of listeners.listener - the listener that will be removedpublic abstract SortedSet<MetricName> getNames()
public abstract SortedMap<MetricName,Gauge> getGauges()
public abstract SortedMap<MetricName,Gauge> getGauges(MetricFilter filter)
filter - the metric filter to matchpublic abstract SortedMap<MetricName,Counter> getCounters()
public abstract SortedMap<MetricName,Counter> getCounters(MetricFilter filter)
filter - the metric filter to matchpublic abstract SortedMap<MetricName,Histogram> getHistograms()
public abstract SortedMap<MetricName,Histogram> getHistograms(MetricFilter filter)
filter - the metric filter to matchpublic abstract SortedMap<MetricName,Meter> getMeters()
public abstract SortedMap<MetricName,Meter> getMeters(MetricFilter filter)
filter - the metric filter to matchpublic abstract SortedMap<MetricName,Timer> getTimers()
public abstract SortedMap<MetricName,Timer> getTimers(MetricFilter filter)
filter - the metric filter to matchpublic abstract SortedMap<MetricName,Compass> getCompasses()
public abstract SortedMap<MetricName,Compass> getCompasses(MetricFilter filter)
filter - the metric filter to matchpublic abstract SortedMap<MetricName,FastCompass> getFastCompasses()
public abstract SortedMap<MetricName,FastCompass> getFastCompasses(MetricFilter filter)
filter - the metric filter to matchpublic abstract SortedMap<MetricName,ClusterHistogram> getClusterHistograms(MetricFilter filter)
ClusterHistogram in the registry and their names which match the given filter.filter - the metric filter to matchClusterHistogram in the registrypublic abstract SortedMap<MetricName,Metric> getMetrics(MetricFilter filter)
filter - the metric filter to matchCopyright © 2019. All rights reserved.