Class MetricStatisticsProvider
- java.lang.Object
-
- org.apache.jackrabbit.oak.plugins.metric.MetricStatisticsProvider
-
- All Implemented Interfaces:
Closeable
,AutoCloseable
,StatisticsProvider
public class MetricStatisticsProvider extends Object implements StatisticsProvider, Closeable
-
-
Field Summary
-
Fields inherited from interface org.apache.jackrabbit.oak.stats.StatisticsProvider
NOOP
-
-
Constructor Summary
Constructors Constructor Description MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
close()
CounterStats
getCounterStats(String name, StatsOptions options)
<T> GaugeStats<T>
getGauge(String name, Supplier<T> supplier)
Creates a newGaugeStats
and registers it under the given name.HistogramStats
getHistogram(String name, StatsOptions options)
MeterStats
getMeter(String name, StatsOptions options)
com.codahale.metrics.MetricRegistry
getRegistry()
RepositoryStatistics
getStats()
TimerStats
getTimer(String name, StatsOptions options)
-
-
-
Constructor Detail
-
MetricStatisticsProvider
public MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor)
-
-
Method Detail
-
close
public void close()
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
-
getStats
public RepositoryStatistics getStats()
- Specified by:
getStats
in interfaceStatisticsProvider
-
getMeter
public MeterStats getMeter(String name, StatsOptions options)
- Specified by:
getMeter
in interfaceStatisticsProvider
-
getCounterStats
public CounterStats getCounterStats(String name, StatsOptions options)
- Specified by:
getCounterStats
in interfaceStatisticsProvider
-
getTimer
public TimerStats getTimer(String name, StatsOptions options)
- Specified by:
getTimer
in interfaceStatisticsProvider
-
getHistogram
public HistogramStats getHistogram(String name, StatsOptions options)
- Specified by:
getHistogram
in interfaceStatisticsProvider
-
getGauge
public <T> GaugeStats<T> getGauge(String name, Supplier<T> supplier)
Description copied from interface:StatisticsProvider
Creates a newGaugeStats
and registers it under the given name. If a gauge with the same exists already then the same instance is returned.- Specified by:
getGauge
in interfaceStatisticsProvider
- Type Parameters:
T
- the type of the metric- Parameters:
name
- the name of the gaugesupplier
- provides the values which are returned by the gauge- Returns:
- the gauge
-
getRegistry
public com.codahale.metrics.MetricRegistry getRegistry()
-
-