public interface MetricRegistry
MetricFilter
Modifier and Type | Interface and Description |
---|---|
static class |
MetricRegistry.Type
An enumeration representing the scopes of the MetricRegistry
|
Modifier and Type | Method and Description |
---|---|
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. |
ConcurrentGauge |
concurrentGauge(Metadata metadata,
Tag... tags)
Return the
ConcurrentGauge registered under the MetricID with the Metadata 's name and
with the provided Tag s; or create and register a new ConcurrentGauge if none is registered. |
ConcurrentGauge |
concurrentGauge(MetricID metricID)
Return the
ConcurrentGauge registered under the MetricID ; or create and register a new
ConcurrentGauge if none is registered. |
ConcurrentGauge |
concurrentGauge(java.lang.String name)
Return the
ConcurrentGauge registered under the MetricID with this name; or create and register a
new ConcurrentGauge if none is registered. |
ConcurrentGauge |
concurrentGauge(java.lang.String name,
Tag... tags)
Return the
ConcurrentGauge registered under the MetricID with this name and with the provided
Tag s; or create and register a new ConcurrentGauge if none is registered. |
Counter |
counter(Metadata metadata)
|
Counter |
counter(Metadata metadata,
Tag... tags)
|
Counter |
counter(MetricID metricID)
|
Counter |
counter(java.lang.String name)
|
Counter |
counter(java.lang.String name,
Tag... tags)
|
<T extends java.lang.Number> |
gauge(Metadata metadata,
java.util.function.Supplier<T> supplier,
Tag... tags)
|
<T,R extends java.lang.Number> |
gauge(Metadata metadata,
T object,
java.util.function.Function<T,R> func,
Tag... tags)
|
<T extends java.lang.Number> |
gauge(MetricID metricID,
java.util.function.Supplier<T> supplier)
|
<T,R extends java.lang.Number> |
gauge(MetricID metricID,
T object,
java.util.function.Function<T,R> func)
|
<T extends java.lang.Number> |
gauge(java.lang.String name,
java.util.function.Supplier<T> supplier,
Tag... tags)
|
<T,R extends java.lang.Number> |
gauge(java.lang.String name,
T object,
java.util.function.Function<T,R> func,
Tag... tags)
|
ConcurrentGauge |
getConcurrentGauge(MetricID metricID)
Return the
ConcurrentGauge registered for the provided MetricID . |
java.util.SortedMap<MetricID,ConcurrentGauge> |
getConcurrentGauges()
Returns a map of all the concurrent gauges in the registry and their
MetricID s. |
java.util.SortedMap<MetricID,ConcurrentGauge> |
getConcurrentGauges(MetricFilter filter)
Returns a map of all the concurrent gauges in the registry and their
MetricID s which match the given
filter. |
Counter |
getCounter(MetricID metricID)
|
java.util.SortedMap<MetricID,Counter> |
getCounters()
Returns a map of all the counters in the registry and their
MetricID s. |
java.util.SortedMap<MetricID,Counter> |
getCounters(MetricFilter filter)
Returns a map of all the counters in the registry and their
MetricID s which match the given filter. |
Gauge<?> |
getGauge(MetricID metricID)
|
java.util.SortedMap<MetricID,Gauge> |
getGauges()
Returns a map of all the gauges in the registry and their
MetricID s. |
java.util.SortedMap<MetricID,Gauge> |
getGauges(MetricFilter filter)
Returns a map of all the gauges in the registry and their
MetricID s which match the given filter. |
Histogram |
getHistogram(MetricID metricID)
|
java.util.SortedMap<MetricID,Histogram> |
getHistograms()
Returns a map of all the histograms in the registry and their
MetricID s. |
java.util.SortedMap<MetricID,Histogram> |
getHistograms(MetricFilter filter)
Returns a map of all the histograms in the registry and their
MetricID s which match the given filter. |
java.util.Map<java.lang.String,Metadata> |
getMetadata()
Returns a map of all the metadata in the registry and their names.
|
Metadata |
getMetadata(java.lang.String name)
Return the
Metadata for the provided name. |
Meter |
getMeter(MetricID metricID)
|
java.util.SortedMap<MetricID,Meter> |
getMeters()
Returns a map of all the meters in the registry and their
MetricID s. |
java.util.SortedMap<MetricID,Meter> |
getMeters(MetricFilter filter)
Returns a map of all the meters in the registry and their
MetricID s which match the given filter. |
Metric |
getMetric(MetricID metricID)
|
<T extends Metric> |
getMetric(MetricID metricID,
java.lang.Class<T> asType)
|
java.util.SortedSet<MetricID> |
getMetricIDs()
Returns a set of the
MetricID s of all the metrics in the registry. |
java.util.Map<MetricID,Metric> |
getMetrics()
Returns a map of all the metrics in the registry and their
MetricID s at query time. |
<T extends Metric> |
getMetrics(java.lang.Class<T> ofType,
MetricFilter filter)
Returns a map of all the metrics in the registry and their
MetricID s which match the given filter and
which are assignable to the provided type. |
java.util.SortedMap<MetricID,Metric> |
getMetrics(MetricFilter filter)
Returns a map of all the metrics in the registry and their
MetricID s which match the given filter. |
java.util.SortedSet<java.lang.String> |
getNames()
Returns a set of the names of all the metrics in the registry.
|
SimpleTimer |
getSimpleTimer(MetricID metricID)
Return the
SimpleTimer registered for the provided MetricID . |
java.util.SortedMap<MetricID,SimpleTimer> |
getSimpleTimers()
Returns a map of all the simple timers in the registry and their
MetricID s. |
java.util.SortedMap<MetricID,SimpleTimer> |
getSimpleTimers(MetricFilter filter)
Returns a map of all the simple timers in the registry and their
MetricID s which match the given filter. |
Timer |
getTimer(MetricID metricID)
|
java.util.SortedMap<MetricID,Timer> |
getTimers()
Returns a map of all the timers in the registry and their
MetricID s. |
java.util.SortedMap<MetricID,Timer> |
getTimers(MetricFilter filter)
Returns a map of all the timers in the registry and their
MetricID s which match the given filter. |
MetricRegistry.Type |
getType()
Returns the type of this metric registry.
|
Histogram |
histogram(Metadata metadata)
|
Histogram |
histogram(Metadata metadata,
Tag... tags)
|
Histogram |
histogram(MetricID metricID)
|
Histogram |
histogram(java.lang.String name)
|
Histogram |
histogram(java.lang.String name,
Tag... tags)
|
Meter |
meter(Metadata metadata)
|
Meter |
meter(Metadata metadata,
Tag... tags)
|
Meter |
meter(MetricID metricID)
|
Meter |
meter(java.lang.String name)
|
Meter |
meter(java.lang.String name,
Tag... tags)
|
static java.lang.String |
name(java.lang.Class<?> klass,
java.lang.String... names)
Concatenates a class name and elements to form a dotted name, eliding any null values or empty strings.
|
static java.lang.String |
name(java.lang.String name,
java.lang.String... names)
Concatenates elements to form a dotted name, eliding any null values or empty strings.
|
<T extends Metric> |
register(Metadata metadata,
T metric)
|
<T extends Metric> |
register(Metadata metadata,
T metric,
Tag... tags)
|
<T extends Metric> |
register(java.lang.String name,
T metric)
|
boolean |
remove(MetricID metricID)
Removes the metric with the given MetricID
|
boolean |
remove(java.lang.String name)
Removes all metrics with the given name.
|
void |
removeMatching(MetricFilter filter)
Removes all metrics which match the given filter.
|
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. |
SimpleTimer |
simpleTimer(Metadata metadata,
Tag... tags)
Return the
SimpleTimer registered under the the MetricID with the Metadata 's name and
with the provided Tag s; or create and register a new SimpleTimer if none is registered. |
SimpleTimer |
simpleTimer(MetricID metricID)
Return the
SimpleTimer registered under the MetricID ; or create and register a new
SimpleTimer if none is registered. |
SimpleTimer |
simpleTimer(java.lang.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. |
SimpleTimer |
simpleTimer(java.lang.String name,
Tag... tags)
Return the
SimpleTimer registered under the MetricID with this name and with the provided
Tag s; or create and register a new SimpleTimer if none is registered. |
Timer |
timer(Metadata metadata)
|
Timer |
timer(Metadata metadata,
Tag... tags)
|
Timer |
timer(MetricID metricID)
|
Timer |
timer(java.lang.String name)
|
Timer |
timer(java.lang.String name,
Tag... tags)
|
static java.lang.String name(java.lang.String name, java.lang.String... names)
name
- the first element of the namenames
- the remaining elements of the namename
and names
concatenated by periodsstatic java.lang.String name(java.lang.Class<?> klass, java.lang.String... names)
klass
- the first element of the namenames
- the remaining elements of the nameklass
and names
concatenated by periods<T extends Metric> T register(java.lang.String name, T metric) throws java.lang.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 metricmetric
java.lang.IllegalArgumentException
- if the name is already registered or if Metadata with different values has already been registered
with the name<T extends Metric> T register(Metadata metadata, T metric) throws java.lang.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 metricmetric
java.lang.IllegalArgumentException
- if the name is already registered or if Metadata with different values has already been registered
with the name<T extends Metric> T register(Metadata metadata, T metric, Tag... tags) throws java.lang.IllegalArgumentException
Metric
and Metadata
, registers both under a MetricID
with the name provided by
the Metadata
and with the provided Tag
s.
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 metricmetric
java.lang.IllegalArgumentException
- if the name is already registered or if Metadata with different values has already been registered
with the nameCounter counter(java.lang.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 metricCounter
Counter counter(java.lang.String name, Tag... tags)
Counter
registered under the MetricID
with this name and with the provided
Tag
s; 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 metricCounter
Counter 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 metricCounter
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 metricCounter
Counter counter(Metadata metadata, Tag... tags)
Counter
registered under the MetricID
with the Metadata
's name and with the
provided Tag
s; 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
ConcurrentGauge concurrentGauge(java.lang.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 metricConcurrentGauge
ConcurrentGauge concurrentGauge(java.lang.String name, Tag... tags)
ConcurrentGauge
registered under the MetricID
with this name and with the provided
Tag
s; 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 metricConcurrentGauge
ConcurrentGauge concurrentGauge(MetricID metricID)
ConcurrentGauge
registered under the MetricID
; 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.metricID
- the ID of the metricConcurrentGauge
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 metricConcurrentGauge
ConcurrentGauge concurrentGauge(Metadata metadata, Tag... tags)
ConcurrentGauge
registered under the MetricID
with the Metadata
's name and
with the provided Tag
s; 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 metricConcurrentGauge
<T,R extends java.lang.Number> Gauge<R> gauge(java.lang.String name, T object, java.util.function.Function<T,R> func, Tag... tags)
Gauge
of type Number
registered under the MetricID
with this
name and with the provided Tag
s; 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 Number
name
- The name of the Gauge metricobject
- The object that the Function
func
will be applied tofunc
- The Function
that will be applied to object
tags
- The tags of the metricGauge
<T,R extends java.lang.Number> Gauge<R> gauge(MetricID metricID, T object, java.util.function.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 Number
metricID
- The MetricID of the Gauge metricobject
- The object that the Function
func
will be applied tofunc
- The Function
that will be applied to object
Gauge
<T,R extends java.lang.Number> Gauge<R> gauge(Metadata metadata, T object, java.util.function.Function<T,R> func, Tag... tags)
Gauge
of type Number
registered under the MetricID
with
the @{link Metadata}'s name and with the provided Tag
s; 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 Number
metadata
- The Metadata of the Gaugeobject
- The object that the Function
func
will be applied tofunc
- The Function
that will be applied to object
tags
- The tags of the metricGauge
<T extends java.lang.Number> Gauge<T> gauge(java.lang.String name, java.util.function.Supplier<T> supplier, Tag... tags)
Gauge
registered under the MetricID
with this name and with the provided Tag
s;
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
- A Number
name
- The name of the Gaugesupplier
- The Supplier
function that will return the value for the Gauge
metrictags
- The tags of the metricGauge
<T extends java.lang.Number> Gauge<T> gauge(MetricID metricID, java.util.function.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 java.lang.Number> Gauge<T> gauge(Metadata metadata, java.util.function.Supplier<T> supplier, Tag... tags)
Gauge
registered under the MetricID
with the @{link Metadata}'s name and with the
provided Tag
s; 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
- A Number
metadata
- The metadata of the gaugesupplier
- The Supplier
function that will return the value for the Gauge
metrictags
- The tags of the metricGauge
Histogram histogram(java.lang.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 metricHistogram
Histogram histogram(java.lang.String name, Tag... tags)
Histogram
registered under the MetricID
with this name and with the provided
Tag
s; 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 metricHistogram
Histogram 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 metricHistogram
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 metricHistogram
Histogram histogram(Metadata metadata, Tag... tags)
Histogram
registered under the MetricID
with the Metadata
's name and with the
provided Tag
s; 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 metricHistogram
Meter meter(java.lang.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 metricMeter
Meter meter(java.lang.String name, Tag... tags)
Meter
registered under the MetricID
with this name and with the provided Tag
s;
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 metricMeter
Meter meter(MetricID metricID)
Meter
registered under the MetricID
; 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.metricID
- the ID of the metricMeter
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 metricMeter
Meter meter(Metadata metadata, Tag... tags)
Meter
registered under the MetricID
with the Metadata
's name and with the
provided Tag
s; 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 metricMeter
Timer timer(java.lang.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 metricTimer
Timer timer(java.lang.String name, Tag... tags)
Timer
registered under the MetricID
with this name and with the provided Tag
s;
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 metricTimer
Timer 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 metricTimer
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 metricTimer
Timer timer(Metadata metadata, Tag... tags)
Timer
registered under the the MetricID
with the Metadata
's name and with the
provided Tag
s; 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
SimpleTimer simpleTimer(java.lang.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 metricSimpleTimer
SimpleTimer simpleTimer(java.lang.String name, Tag... tags)
SimpleTimer
registered under the MetricID
with this name and with the provided
Tag
s; 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 metricSimpleTimer
SimpleTimer simpleTimer(MetricID metricID)
SimpleTimer
registered under the MetricID
; 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.metricID
- the ID of the metricSimpleTimer
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 metricSimpleTimer
SimpleTimer simpleTimer(Metadata metadata, Tag... tags)
SimpleTimer
registered under the the MetricID
with the Metadata
's name and
with the provided Tag
s; 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 metricSimpleTimer
<T extends Metric> T getMetric(MetricID metricID, java.lang.Class<T> asType)
metricID
- lookup key, not null
asType
- 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 farjava.lang.IllegalArgumentException
- If the registered metric was not assignable to the provided typeConcurrentGauge getConcurrentGauge(MetricID metricID)
ConcurrentGauge
registered for the provided MetricID
.metricID
- lookup key, not null
ConcurrentGauge
registered for the key or null
if none has been registered so farjava.lang.IllegalArgumentException
- If the registered metric was not assignable to ConcurrentGauge
SimpleTimer getSimpleTimer(MetricID metricID)
SimpleTimer
registered for the provided MetricID
.metricID
- lookup key, not null
SimpleTimer
registered for the key or null
if none has been registered so farjava.lang.IllegalArgumentException
- If the registered metric was not assignable to SimpleTimer
Metadata getMetadata(java.lang.String name)
Metadata
for the provided name.name
- the name of the metricMetadata
for the provided name of null
if none has been registered for that nameboolean remove(java.lang.String name)
name
- the name of the metricboolean remove(MetricID metricID)
metricID
- the MetricID of the metricvoid removeMatching(MetricFilter filter)
filter
- a filterjava.util.SortedSet<java.lang.String> getNames()
java.util.SortedSet<MetricID> getMetricIDs()
MetricID
s of all the metrics in the registry.java.util.SortedMap<MetricID,Gauge> getGauges()
MetricID
s.java.util.SortedMap<MetricID,Gauge> getGauges(MetricFilter filter)
MetricID
s which match the given filter.filter
- the metric filter to matchjava.util.SortedMap<MetricID,Counter> getCounters()
MetricID
s.java.util.SortedMap<MetricID,Counter> getCounters(MetricFilter filter)
MetricID
s which match the given filter.filter
- the metric filter to matchjava.util.SortedMap<MetricID,ConcurrentGauge> getConcurrentGauges()
MetricID
s.java.util.SortedMap<MetricID,ConcurrentGauge> getConcurrentGauges(MetricFilter filter)
MetricID
s which match the given
filter.filter
- the metric filter to matchjava.util.SortedMap<MetricID,Histogram> getHistograms()
MetricID
s.java.util.SortedMap<MetricID,Histogram> getHistograms(MetricFilter filter)
MetricID
s which match the given filter.filter
- the metric filter to matchjava.util.SortedMap<MetricID,Meter> getMeters()
MetricID
s.java.util.SortedMap<MetricID,Meter> getMeters(MetricFilter filter)
MetricID
s which match the given filter.filter
- the metric filter to matchjava.util.SortedMap<MetricID,Timer> getTimers()
MetricID
s.java.util.SortedMap<MetricID,Timer> getTimers(MetricFilter filter)
MetricID
s which match the given filter.filter
- the metric filter to matchjava.util.SortedMap<MetricID,SimpleTimer> getSimpleTimers()
MetricID
s.java.util.SortedMap<MetricID,SimpleTimer> getSimpleTimers(MetricFilter filter)
MetricID
s which match the given filter.filter
- the metric filter to matchjava.util.SortedMap<MetricID,Metric> getMetrics(MetricFilter filter)
MetricID
s which match the given filter.filter
- the metric filter to match<T extends Metric> java.util.SortedMap<MetricID,T> getMetrics(java.lang.Class<T> ofType, MetricFilter filter)
MetricID
s 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 matchjava.util.Map<MetricID,Metric> getMetrics()
MetricID
s 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)
.java.util.Map<java.lang.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)
}.MetricRegistry.Type getType()