public class MetricRegistry extends Object
Constructor and Description |
---|
MetricRegistry(MetricProvider metricProvider) |
Modifier and Type | Method and Description |
---|---|
Counter |
counter(MetricId id)
|
Gauge |
gauge(MetricId id,
StatisticConfig... statisticConfigs)
|
Metric[] |
getAllMetrics() |
MetricProvider |
getMetricProvider() |
Metric |
lookup(MetricId metricId) |
<T> PolledGauge |
polledGauge(MetricId id,
T obj,
ToDoubleFunction<T> valueFunction)
|
Counter |
register(Counter counter)
Registers the counter metrics instance.
|
Gauge |
register(Gauge gauge)
Registers the gauge metrics instance.
|
PolledGauge |
register(PolledGauge gauge)
Registers the polled gauge metrics instance.
|
void |
remove(String name)
Removes the metric with the given name.
|
void |
unregister(Counter counter)
Unregister the counter metrics instance.
|
void |
unregister(Gauge gauge)
Unregister the gauge metrics instance.
|
void |
unregister(PolledGauge gauge)
Unregisters the polled gauge metrics instance.
|
public MetricRegistry(MetricProvider metricProvider)
public void unregister(Counter counter)
counter
- The Counter
instance.public Gauge gauge(MetricId id, StatisticConfig... statisticConfigs)
id
- The MetricId
.statisticConfigs
- statistic configurations
to summarize gauge values.Gauge
metric.public void unregister(Gauge gauge)
gauge
- The Gauge
instance.public <T> PolledGauge polledGauge(MetricId id, T obj, ToDoubleFunction<T> valueFunction)
T
- The type of the state object from which the gauge value is extracted.id
- The MetricId
.obj
- State object used to compute a value.valueFunction
- Function that produces an instantaneous gauge value from the state object.PolledGauge
metric.public PolledGauge register(PolledGauge gauge)
gauge
- The PolledGauge
instance.PolledGauge
metric.public void unregister(PolledGauge gauge)
gauge
- The PolledGauge
instance.public void remove(String name)
name
- the name of the metricpublic MetricProvider getMetricProvider()
public Metric[] getAllMetrics()
Copyright © 2018 WSO2. All rights reserved.