@ProviderType
public interface MetricsService
MetricsService
enables creation of various types of Metric
.Modifier and Type | Field and Description |
---|---|
static MetricsService |
NOOP
Dummy variant of MetricsService which does not
collect any metric
|
Modifier and Type | Method and Description |
---|---|
<A> A |
adaptTo(Class<A> type)
Adapts the service to the specified type.
|
Counter |
counter(String name)
Creates a new
Counter and registers it under the given name. |
Histogram |
histogram(String name)
Creates a new
Histogram and registers it under the given name. |
Meter |
meter(String name)
Creates a new
Meter and registers it under the given name. |
Timer |
timer(String name)
Creates a new
Timer and registers it under the given name. |
static final MetricsService NOOP
Timer timer(String name)
Timer
and registers it under the given name.
If a timer with same name exists then same instance is returnedname
- the name of the metricTimer
Histogram histogram(String name)
Histogram
and registers it under the given name.
If a histogram with same name exists then same instance is returned.name
- the name of the metricHistogram
Counter counter(String name)
Counter
and registers it under the given name.
If a counter with same name exists then same instance is returnedname
- the name of the metricCounter
Meter meter(String name)
Meter
and registers it under the given name.
If a meter with same name exists then same instance is returnedname
- the name of the metricMeter
<A> A adaptTo(Class<A> type)
MetricRegistry
A
- The type to which this metric is to be adapted.type
- Class object for the type to which this metric is to be adapted.Copyright © 2017 The Apache Software Foundation. All rights reserved.