public interface MetricRegistry
MetricFilter| Modifier and Type | Field and Description |
|---|---|
static String |
APPLICATION_SCOPE
String constant to represent the scope value used for the application scope
|
static String |
BASE_SCOPE
String constant to represent the scope value used for the base scope
|
static String |
VENDOR_SCOPE
String constant to represent the scope value used for the vendor scope
|
| Modifier and Type | Method and Description |
|---|---|
Counter |
counter(Metadata metadata)
|
Counter |
counter(Metadata metadata,
Tag... tags)
|
Counter |
counter(MetricID metricID)
|
Counter |
counter(String name)
|
Counter |
counter(String name,
Tag... tags)
|
<T extends Number> |
gauge(Metadata metadata,
Supplier<T> supplier,
Tag... tags)
|
<T,R extends Number> |
gauge(Metadata metadata,
T object,
Function<T,R> func,
Tag... tags)
|
<T extends Number> |
gauge(MetricID metricID,
Supplier<T> supplier)
|
<T,R extends Number> |
gauge(MetricID metricID,
T object,
Function<T,R> func)
|
<T extends Number> |
gauge(String name,
Supplier<T> supplier,
Tag... tags)
|
<T,R extends Number> |
gauge(String name,
T object,
Function<T,R> func,
Tag... tags)
|
Counter |
getCounter(MetricID metricID)
|
SortedMap<MetricID,Counter> |
getCounters()
Returns a map of all the counters in the registry and their
MetricIDs. |
SortedMap<MetricID,Counter> |
getCounters(MetricFilter filter)
Returns a map of all the counters in the registry and their
MetricIDs which match the given filter. |
Gauge<?> |
getGauge(MetricID metricID)
|
SortedMap<MetricID,Gauge> |
getGauges()
Returns a map of all the gauges in the registry and their
MetricIDs. |
SortedMap<MetricID,Gauge> |
getGauges(MetricFilter filter)
Returns a map of all the gauges in the registry and their
MetricIDs which match the given filter. |
Histogram |
getHistogram(MetricID metricID)
|
SortedMap<MetricID,Histogram> |
getHistograms()
Returns a map of all the histograms in the registry and their
MetricIDs. |
SortedMap<MetricID,Histogram> |
getHistograms(MetricFilter filter)
Returns a map of all the histograms in the registry and their
MetricIDs which match the given filter. |
Map<String,Metadata> |
getMetadata()
Returns a map of all the metadata in the registry and their names.
|
Metadata |
getMetadata(String name)
Return the
Metadata for the provided name. |
Metric |
getMetric(MetricID metricID)
|
<T extends Metric> |
getMetric(MetricID metricID,
Class<T> asType)
|
SortedSet<MetricID> |
getMetricIDs()
Returns a set of the
MetricIDs of all the metrics in the registry. |
Map<MetricID,Metric> |
getMetrics()
Returns a map of all the metrics in the registry and their
MetricIDs at query time. |
<T extends Metric> |
getMetrics(Class<T> ofType,
MetricFilter filter)
Returns a map of all the metrics in the registry and their
MetricIDs which match the given filter and
which are assignable to the provided type. |
SortedMap<MetricID,Metric> |
getMetrics(MetricFilter filter)
Returns a map of all the metrics in the registry and their
MetricIDs which match the given filter. |
SortedSet<String> |
getNames()
Returns a set of the names of all the metrics in the registry.
|
String |
getScope()
Returns the scope of this metric registry.
|
Timer |
getTimer(MetricID metricID)
|
SortedMap<MetricID,Timer> |
getTimers()
Returns a map of all the timers in the registry and their
MetricIDs. |
SortedMap<MetricID,Timer> |
getTimers(MetricFilter filter)
Returns a map of all the timers in the registry and their
MetricIDs which match the given filter. |
Histogram |
histogram(Metadata metadata)
|
Histogram |
histogram(Metadata metadata,
Tag... tags)
|
Histogram |
histogram(MetricID metricID)
|
Histogram |
histogram(String name)
|
Histogram |
histogram(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.
|
boolean |
remove(MetricID metricID)
Removes the metric with the given MetricID
|
boolean |
remove(String name)
Removes all metrics with the given name.
|
void |
removeMatching(MetricFilter filter)
Removes all metrics which match the given filter.
|
Timer |
timer(Metadata metadata)
|
Timer |
timer(Metadata metadata,
Tag... tags)
|
Timer |
timer(MetricID metricID)
|
Timer |
timer(String name)
|
Timer |
timer(String name,
Tag... tags)
|
static final String APPLICATION_SCOPE
static final String VENDOR_SCOPE
static final String BASE_SCOPE
static String name(String name, String... names)
name - the first element of the namenames - the remaining elements of the namename and names concatenated by periodsstatic String name(Class<?> klass, String... names)
klass - the first element of the namenames - the remaining elements of the nameklass and names concatenated by periodsCounter 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 metricCounterCounter 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 metricCounterCounter counter(MetricID metricID)
Counter registered under the MetricID; 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.metricID - the ID of the metricCounterCounter 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 metricCounterCounter 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 metricCounter<T,R extends Number> Gauge<R> gauge(String name, T object, Function<T,R> func, Tag... tags)
Gauge of type Number registered under the MetricID with this
name and with the provided Tags; or create and register this gauge if none is registered.
If a Gauge 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.
The created Gauge will apply a Function to the provided object to
resolve a Number value.T - The Type of the Object of which the function func is applied toR - A Numbername - The name of the Gauge metricobject - The object that the Function func will be applied tofunc - The Function that will be applied to objecttags - The tags of the metricGauge<T,R extends Number> Gauge<R> gauge(MetricID metricID, T object, Function<T,R> func)
Gauge of type Number registered under the MetricID; or create
and register this gauge if none is registered.
If a Gauge 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.
The created Gauge will apply a Function to the provided object to
resolve a Number value.T - The Type of the Object of which the function func is applied toR - A NumbermetricID - The MetricID of the Gauge metricobject - The object that the Function func will be applied tofunc - The Function that will be applied to objectGauge<T,R extends Number> Gauge<R> gauge(Metadata metadata, T object, Function<T,R> func, Tag... tags)
Gauge of type Number registered under the MetricID with
the @{link Metadata}'s name and with the provided Tags; or create and register this gauge if none is
registered.
If a Gauge 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.
The created Gauge will apply a Function to the provided object to
resolve a Number value.T - The Type of the Object of which the function func is applied toR - A Numbermetadata - The Metadata of the Gaugeobject - The object that the Function func will be applied tofunc - The Function that will be applied to objecttags - The tags of the metricGauge<T extends Number> Gauge<T> gauge(String name, Supplier<T> supplier, Tag... tags)
Gauge registered under the MetricID with this name and with the provided Tags;
or create and register this gauge if none is registered.
If a Gauge 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.
The created Gauge will return the value that the Supplier will
provide.<T extends Number> Gauge<T> gauge(MetricID metricID, Supplier<T> supplier)
Gauge registered under the MetricID; or create and register this gauge if none is
registered.
If a Gauge 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.
The created Gauge will return the value that the Supplier will
provide.<T extends Number> Gauge<T> gauge(Metadata metadata, Supplier<T> supplier, Tag... tags)
Gauge registered under the MetricID with the @{link Metadata}'s name and with the
provided Tags; or create and register this gauge if none is registered.
If a Gauge 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.
The created Gauge will return the value that the Supplier will
provide.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 metricHistogramHistogram 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 metricHistogramHistogram histogram(MetricID metricID)
Histogram registered under the MetricID; 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.metricID - the ID of the metricHistogramHistogram 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 metricHistogramHistogram 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 metricHistogramTimer 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 metricTimerTimer 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 metricTimerTimer timer(MetricID metricID)
Timer registered under the MetricID; 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.metricID - the ID of the metricTimerTimer 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 metricTimerTimer 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 metricTimer<T extends Metric> T getMetric(MetricID metricID, Class<T> asType)
metricID - lookup key, not nullasType - the return type which is expected to be compatible with the actual type of the registered metricMetric registered for the provided MetricID or null if none has been
registered so farIllegalArgumentException - If the registered metric was not assignable to the provided typeCounter getCounter(MetricID metricID)
metricID - lookup key, not nullCounter registered for the key or null if none has been registered so farIllegalArgumentException - If the registered metric was not assignable to CounterGauge<?> getGauge(MetricID metricID)
metricID - lookup key, not nullGauge registered for the key or null if none has been registered so farIllegalArgumentException - If the registered metric was not assignable to GaugeHistogram getHistogram(MetricID metricID)
metricID - lookup key, not nullHistogram registered for the key or null if none has been registered so farIllegalArgumentException - If the registered metric was not assignable to HistogramTimer getTimer(MetricID metricID)
metricID - lookup key, not nullTimer registered for the key or null if none has been registered so farIllegalArgumentException - If the registered metric was not assignable to TimerMetadata getMetadata(String name)
Metadata for the provided name.name - the name of the metricMetadata for the provided name or null if none has been registered for that nameboolean remove(String name)
name - the name of the metricboolean remove(MetricID metricID)
metricID - the MetricID of the metricvoid removeMatching(MetricFilter filter)
filter - a filterSortedSet<String> getNames()
SortedSet<MetricID> getMetricIDs()
MetricIDs of all the metrics in the registry.SortedMap<MetricID,Gauge> getGauges()
MetricIDs.SortedMap<MetricID,Gauge> getGauges(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchSortedMap<MetricID,Counter> getCounters()
MetricIDs.SortedMap<MetricID,Counter> getCounters(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchSortedMap<MetricID,Histogram> getHistograms()
MetricIDs.SortedMap<MetricID,Histogram> getHistograms(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchSortedMap<MetricID,Timer> getTimers()
MetricIDs.SortedMap<MetricID,Timer> getTimers(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to matchSortedMap<MetricID,Metric> getMetrics(MetricFilter filter)
MetricIDs which match the given filter.filter - the metric filter to match<T extends Metric> SortedMap<MetricID,T> getMetrics(Class<T> ofType, MetricFilter filter)
MetricIDs which match the given filter and
which are assignable to the provided type.ofType - the type to which all returned metrics should be assignablefilter - the metric filter to matchMap<MetricID,Metric> getMetrics()
MetricIDs at query time. The only guarantee
about this method is that any key has a value (compared to using getMetric(MetricID) and
getMetricIDs() together).
It is only intended for bulk querying, if you need a single or a few entries, always prefer
getMetric(MetricID) or getMetrics(MetricFilter).Map<String,Metadata> getMetadata()
getMetadata(String).
It is only intended for bulk querying, if you need a single or a few metadata, always prefer
getMetadata(String)}.String getScope()
Copyright © 2017 – 2022 Eclipse Foundation. All rights reserved.
Use is subject to license terms.