public class MetricListener extends Object
Modifier and Type | Field and Description |
---|---|
static String |
DELIMITER |
static String |
ROOT_METRIC_GROUP_NAME |
Constructor and Description |
---|
MetricListener() |
Modifier and Type | Method and Description |
---|---|
Optional<Counter> |
getCounter(String... identifier)
Get registered
Counter with identifier relative to the root metric group. |
<T> Optional<Gauge<T>> |
getGauge(String... identifier)
Get registered
Gauge with identifier relative to the root metric group. |
Optional<Histogram> |
getHistogram(String... identifier)
Get registered
Histogram with identifier relative to the root metric group. |
Optional<Meter> |
getMeter(String... identifier)
Get registered
Meter with identifier relative to the root metric group. |
<T extends Metric> |
getMetric(Class<T> metricType,
String... identifier)
Get registered
Metric with identifier relative to the root metric group. |
MetricGroup |
getMetricGroup()
Get the root metric group of this listener.
|
public static final String DELIMITER
public static final String ROOT_METRIC_GROUP_NAME
public MetricGroup getMetricGroup()
public <T extends Metric> Optional<T> getMetric(Class<T> metricType, String... identifier)
Metric
with identifier relative to the root metric group.
For example, identifier of metric "myMetric" registered in group "myGroup" under root metric group can be reached by identifier ("myGroup", "myMetric")
identifier
- identifier relative to the root metric grouppublic Optional<Meter> getMeter(String... identifier)
Meter
with identifier relative to the root metric group.identifier
- identifier relative to the root metric grouppublic Optional<Counter> getCounter(String... identifier)
Counter
with identifier relative to the root metric group.identifier
- identifier relative to the root metric grouppublic Optional<Histogram> getHistogram(String... identifier)
Histogram
with identifier relative to the root metric group.identifier
- identifier relative to the root metric groupCopyright © 2014–2024 The Apache Software Foundation. All rights reserved.