public abstract class MetricRegistry extends Object
MetricFilter| Modifier and Type | Class and Description |
|---|---|
static class |
MetricRegistry.Type
An enumeration representing the scopes of the MetricRegistry
|
| Constructor and Description |
|---|
MetricRegistry() |
| Modifier and Type | Method and Description |
|---|---|
abstract ConcurrentGauge |
concurrentGauge(Metadata metadata)
Return the
ConcurrentGauge registered under the MetricID with the Metadata's name;
or create and register a new ConcurrentGauge if none is registered. |
abstract ConcurrentGauge |
concurrentGauge(Metadata metadata,
Tag... tags)
Return the
ConcurrentGauge registered under the MetricID with the Metadata's name and
with the provided Tags; or create and register a new ConcurrentGauge if none is registered. |
abstract ConcurrentGauge |
concurrentGauge(String name)
Return the
ConcurrentGauge registered under the MetricID with this name; or create and register
a new ConcurrentGauge if none is registered. |
abstract ConcurrentGauge |
concurrentGauge(String name,
Tag... tags)
Return the
ConcurrentGauge registered under the MetricID with this name and
with the provided Tags; or create and register a new ConcurrentGauge if none is registered. |
abstract Counter |
counter(Metadata metadata)
|
abstract Counter |
counter(Metadata metadata,
Tag... tags)
|
abstract Counter |
counter(String name)
|
abstract Counter |
counter(String name,
Tag... tags)
|
abstract SortedMap<MetricID,ConcurrentGauge> |
getConcurrentGauges()
Returns a map of all the concurrent gauges in the registry and their
MetricIDs. |
abstract SortedMap<MetricID,ConcurrentGauge> |
getConcurrentGauges(MetricFilter filter)
Returns a map of all the concurrent gauges in the registry and their
MetricIDs which match
the given filter. |
abstract SortedMap<MetricID,Counter> |
getCounters()
Returns a map of all the counters in the registry and their
MetricIDs. |
abstract SortedMap<MetricID,Counter> |
getCounters(MetricFilter filter)
Returns a map of all the counters in the registry and their
MetricIDs which match the given
filter. |
abstract SortedMap<MetricID,Gauge> |
getGauges()
Returns a map of all the gauges in the registry and their
MetricIDs. |
abstract SortedMap<MetricID,Gauge> |
getGauges(MetricFilter filter)
Returns a map of all the gauges in the registry and their
MetricIDs which match the given filter. |
abstract SortedMap<MetricID,Histogram> |
getHistograms()
Returns a map of all the histograms in the registry and their
MetricIDs. |
abstract SortedMap<MetricID,Histogram> |
getHistograms(MetricFilter filter)
Returns a map of all the histograms in the registry and their
MetricIDs which match the given
filter. |
abstract Map<String,Metadata> |
getMetadata()
Returns a map of all the metadata in the registry and their names.
|
abstract SortedMap<MetricID,Meter> |
getMeters()
Returns a map of all the meters in the registry and their
MetricIDs. |
abstract SortedMap<MetricID,Meter> |
getMeters(MetricFilter filter)
Returns a map of all the meters in the registry and their
MetricIDs which match the given filter. |
abstract SortedSet<MetricID> |
getMetricIDs()
Returns a set of the
MetricIDs of all the metrics in the registry. |
abstract Map<MetricID,Metric> |
getMetrics()
Returns a map of all the metrics in the registry and their
MetricIDs. |
abstract SortedSet<String> |
getNames()
Returns a set of the names of all the metrics in the registry.
|
abstract SortedMap<MetricID,SimpleTimer> |
getSimpleTimers()
Returns a map of all the simple timers in the registry and their
MetricIDs. |
abstract SortedMap<MetricID,SimpleTimer> |
getSimpleTimers(MetricFilter filter)
Returns a map of all the simple timers in the registry and their
MetricIDs which match the given filter. |
abstract SortedMap<MetricID,Timer> |
getTimers()
Returns a map of all the timers in the registry and their
MetricIDs. |
abstract SortedMap<MetricID,Timer> |
getTimers(MetricFilter filter)
Returns a map of all the timers in the registry and their
MetricIDs which match the given filter. |
abstract Histogram |
histogram(Metadata metadata)
|
abstract Histogram |
histogram(Metadata metadata,
Tag... tags)
|
abstract Histogram |
histogram(String name)
|
abstract Histogram |
histogram(String name,
Tag... tags)
|
abstract Meter |
meter(Metadata metadata)
|
abstract Meter |
meter(Metadata metadata,
Tag... tags)
|
abstract Meter |
meter(String name)
|
abstract Meter |
meter(String name,
Tag... tags)
|
static String |
name(Class<?> klass,
String... names)
Concatenates a class name and elements to form a dotted name, eliding any null values or
empty strings.
|
static String |
name(String name,
String... names)
Concatenates elements to form a dotted name, eliding any null values or empty strings.
|
abstract <T extends Metric> |
register(Metadata metadata,
T metric)
|
abstract <T extends Metric> |
register(Metadata metadata,
T metric,
Tag... tags)
|
abstract <T extends Metric> |
register(String name,
T metric)
|
abstract boolean |
remove(MetricID metricID)
Removes the metric with the given MetricID
|
abstract boolean |
remove(String name)
Removes all metrics with the given name.
|
abstract void |
removeMatching(MetricFilter filter)
Removes all metrics which match the given filter.
|
abstract SimpleTimer |
simpleTimer(Metadata metadata)
Return the
SimpleTimer registered under the the MetricID with the Metadata's name and
with no tags; or create and register a new SimpleTimer if none is registered. |
abstract SimpleTimer |
simpleTimer(Metadata metadata,
Tag... tags)
Return the
SimpleTimer registered under the the MetricID with the Metadata's name and
with the provided Tags; or create and register a new SimpleTimer if none is registered. |
abstract SimpleTimer |
simpleTimer(String name)
Return the
SimpleTimer registered under the MetricID with this name and with no tags; or create
and register a new SimpleTimer if none is registered. |
abstract SimpleTimer |
simpleTimer(String name,
Tag... tags)
Return the
SimpleTimer registered under the MetricID with this name and with the provided Tags;
or create and register a new SimpleTimer if none is registered. |
abstract Timer |
timer(Metadata metadata)
|
abstract Timer |
timer(Metadata metadata,
Tag... tags)
|
abstract Timer |
timer(String name)
|
abstract Timer |
timer(String name,
Tag... tags)
|
public static String name(String name, String... names)
name - the first element of the namenames - the remaining elements of the namename and names concatenated by periodspublic static String name(Class<?> klass, String... names)
klass - the first element of the namenames - the remaining elements of the nameklass and names concatenated by periodspublic abstract <T extends Metric> T register(String name, T metric) throws IllegalArgumentException
Metric, registers it under a MetricID with the given name and with no tags.
A Metadata object will be registered with the name and type.
However, if a Metadata object is already registered with this metric name and is not equal
to the created Metadata object then an exception will be thrown.T - the type of the metricname - the name of the metricmetric - the metricmetricIllegalArgumentException - if the name is already registered or if Metadata with different
values has already been registered with the namepublic abstract <T extends Metric> T register(Metadata metadata, T metric) throws IllegalArgumentException
Metric and Metadata, registers the metric with a MetricID with the
name provided by the Metadata and with no tags.
Note: If a Metadata object is already registered under this metric name and is not equal
to the provided Metadata object then an exception will be thrown.
T - the type of the metricmetadata - the metadatametric - the metricmetricIllegalArgumentException - if the name is already registered or if Metadata with different
values has already been registered with the namepublic abstract <T extends Metric> T register(Metadata metadata, T metric, Tag... tags) throws IllegalArgumentException
Metric and Metadata, registers both under a MetricID with the
name provided by the Metadata and with the provided Tags.
Note: If a Metadata object is already registered under this metric name and is not equal
to the provided Metadata object then an exception will be thrown.
T - the type of the metricmetadata - the metadatametric - the metrictags - the tags of the metricmetricIllegalArgumentException - if the name is already registered or if Metadata with different
values has already been registered with the namepublic abstract Counter counter(String name)
Counter registered under the MetricID with this name and with no tags;
or create and register a new Counter if none is registered.
If a Counter was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metricCounterpublic abstract Counter counter(String name, Tag... tags)
Counter registered under the MetricID with this name and with the provided
Tags; or create and register a new Counter if none is registered.
If a Counter was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metrictags - the tags of the metricCounterpublic abstract Counter counter(Metadata metadata)
Counter registered under the MetricID with the Metadata's name and
with no tags; or create and register a new Counter if none is registered. If a Counter
was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this
metric name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metricCounterpublic abstract Counter counter(Metadata metadata, Tag... tags)
Counter registered under the MetricID with the Metadata's name and
with the provided Tags; or create and register a new Counter if none is registered.
If a Counter was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this
metric name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metrictags - the tags of the metricCounterpublic abstract ConcurrentGauge concurrentGauge(String name)
ConcurrentGauge registered under the MetricID with this name; or create and register
a new ConcurrentGauge if none is registered.
If a ConcurrentGauge was created, a Metadata object will be registered with the name and type.name - the name of the metricConcurrentGaugepublic abstract ConcurrentGauge concurrentGauge(String name, Tag... tags)
ConcurrentGauge registered under the MetricID with this name and
with the provided Tags; or create and register a new ConcurrentGauge if none is registered.
If a ConcurrentGauge was created, a Metadata object will be registered with the name and type.name - the name of the metrictags - the tags of the metricConcurrentGaugepublic abstract ConcurrentGauge concurrentGauge(Metadata metadata)
ConcurrentGauge registered under the MetricID with the Metadata's name;
or create and register a new ConcurrentGauge if none is registered.
If a ConcurrentGauge was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under
this metric name and is not equal to the provided Metadata object then an exception
will be thrown.
metadata - the name of the metricConcurrentGaugepublic abstract ConcurrentGauge concurrentGauge(Metadata metadata, Tag... tags)
ConcurrentGauge registered under the MetricID with the Metadata's name and
with the provided Tags; or create and register a new ConcurrentGauge if none is registered.
If a ConcurrentGauge was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under
this metric name and is not equal to the provided Metadata object then an exception
will be thrown.
metadata - the name of the metrictags - the tags of the metricConcurrentGaugepublic abstract Histogram histogram(String name)
Histogram registered under the MetricID with this name and with no tags;
or create and register a new Histogram if none is registered.
If a Histogram was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metricHistogrampublic abstract Histogram histogram(String name, Tag... tags)
Histogram registered under the MetricID with this name and with the
provided Tags; or create and register a new Histogram if none is registered.
If a Histogram was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metrictags - the tags of the metricHistogrampublic abstract Histogram histogram(Metadata metadata)
Histogram registered under the MetricID with the Metadata's
name and with no tags; or create and register a new Histogram if none is registered.
If a Histogram was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under
this metric name and is not equal to the provided Metadata object then an exception
will be thrown.
metadata - the name of the metricHistogrampublic abstract Histogram histogram(Metadata metadata, Tag... tags)
Histogram registered under the MetricID with the Metadata's
name and with the provided Tags; or create and register a new Histogram if none is registered.
If a Histogram was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under
this metric name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metrictags - the tags of the metricHistogrampublic abstract Meter meter(String name)
Meter registered under the MetricID with this name and with no tags; or
create and register a new Meter if none is registered.
If a Meter was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metricMeterpublic abstract Meter meter(String name, Tag... tags)
Meter registered under the MetricID with this name and with the provided Tags;
or create and register a new Meter if none is registered.
If a Meter was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metrictags - the tags of the metricMeterpublic abstract Meter meter(Metadata metadata)
Meter registered under the MetricID with the Metadata's name and with
no tags; or create and register a new Meter if none is registered. If a Meter was created,
the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this metric
name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metricMeterpublic abstract Meter meter(Metadata metadata, Tag... tags)
Meter registered under the MetricID with the Metadata's name and with
the provided Tags; or create and register a new Meter if none is registered. If a Meter was
created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this metric name
and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metrictags - the tags of the metricMeterpublic abstract Timer timer(String name)
Timer registered under the MetricID with this name and with no tags; or create
and register a new Timer if none is registered.
If a Timer was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metricTimerpublic abstract Timer timer(String name, Tag... tags)
Timer registered under the MetricID with this name and with the provided Tags;
or create and register a new Timer if none is registered.
If a Timer was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metrictags - the tags of the metricTimerpublic abstract Timer timer(Metadata metadata)
Timer registered under the the MetricID with the Metadata's name and
with no tags; or create and register a new Timer if none is registered. If a Timer was
created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this metric
name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metricTimerpublic abstract Timer timer(Metadata metadata, Tag... tags)
Timer registered under the the MetricID with the Metadata's name and
with the provided Tags; or create and register a new Timer if none is registered.
If a Timer was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this metric
name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metrictags - the tags of the metricTimerpublic abstract SimpleTimer simpleTimer(String name)
SimpleTimer registered under the MetricID with this name and with no tags; or create
and register a new SimpleTimer if none is registered.
If a SimpleTimer was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metricSimpleTimerpublic abstract SimpleTimer simpleTimer(String name, Tag... tags)
SimpleTimer registered under the MetricID with this name and with the provided Tags;
or create and register a new SimpleTimer if none is registered.
If a SimpleTimer was created, a Metadata object will be registered with the name
and type. If a Metadata object is already registered with this metric name then that
Metadata will be used.name - the name of the metrictags - the tags of the metricSimpleTimerpublic abstract SimpleTimer simpleTimer(Metadata metadata)
SimpleTimer registered under the the MetricID with the Metadata's name and
with no tags; or create and register a new SimpleTimer if none is registered. If a SimpleTimer was
created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this metric
name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metricSimpleTimerpublic abstract SimpleTimer simpleTimer(Metadata metadata, Tag... tags)
SimpleTimer registered under the the MetricID with the Metadata's name and
with the provided Tags; or create and register a new SimpleTimer if none is registered.
If a SimpleTimer was created, the provided Metadata object will be registered.
Note: During retrieval or creation, if a Metadata object is already registered under this metric
name and is not equal to the provided Metadata object then an exception will be thrown.
metadata - the name of the metrictags - the tags of the metricSimpleTimerpublic abstract boolean remove(String name)
name - the name of the metricpublic abstract boolean remove(MetricID metricID)
metricID - the MetricID of the metricpublic abstract void removeMatching(MetricFilter filter)
filter - a filterpublic abstract SortedSet<String> getNames()
public abstract SortedSet<MetricID> getMetricIDs()
MetricIDs of all the metrics in the registry.public abstract SortedMap<MetricID,Gauge> getGauges()
MetricIDs.public abstract SortedMap<MetricID,Gauge> getGauges(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchpublic abstract SortedMap<MetricID,Counter> getCounters()
MetricIDs.public abstract SortedMap<MetricID,Counter> getCounters(MetricFilter filter)
MetricIDs which match the given
filter.filter - the metric filter to matchpublic abstract SortedMap<MetricID,ConcurrentGauge> getConcurrentGauges()
MetricIDs.public abstract SortedMap<MetricID,ConcurrentGauge> getConcurrentGauges(MetricFilter filter)
MetricIDs which match
the given filter.filter - the metric filter to matchpublic abstract SortedMap<MetricID,Histogram> getHistograms()
MetricIDs.public abstract SortedMap<MetricID,Histogram> getHistograms(MetricFilter filter)
MetricIDs which match the given
filter.filter - the metric filter to matchpublic abstract SortedMap<MetricID,Meter> getMeters()
MetricIDs.public abstract SortedMap<MetricID,Meter> getMeters(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchpublic abstract SortedMap<MetricID,Timer> getTimers()
MetricIDs.public abstract SortedMap<MetricID,Timer> getTimers(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchpublic abstract SortedMap<MetricID,SimpleTimer> getSimpleTimers()
MetricIDs.public abstract SortedMap<MetricID,SimpleTimer> getSimpleTimers(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchpublic abstract Map<MetricID,Metric> getMetrics()
MetricIDs.Copyright © 2020. All rights reserved.