MetricStatisticsProvider implements StatisticsProvider, Closeable { @Override public TimerStats getTimer(String name, StatsOptions options) { return getStats(name, StatsBuilder.TIMERS, options); } MetricStatisticsProvider(MBeanServer server, ScheduledExecutorService executor); void close(); @Override RepositoryStatistics getStats(); @Override MeterStats getMeter(String name, StatsOptions options); @Override CounterStats getCounterStats(String name, StatsOptions options); @Override TimerStats getTimer(String name, StatsOptions options); @Override HistogramStats getHistogram(String name, StatsOptions options); MetricRegistry getRegistry();  }
@Test public void jmxNaming() throws Exception { TimerStats timerStats = statsProvider.getTimer("hello", StatsOptions.DEFAULT); assertNotNull(server.getObjectInstance(new ObjectName("org.apache.jackrabbit.oak:type=Metrics,name=hello"))); }
@Test public void statsOptions_TimeSeriesOnly() throws Exception{ assertInstanceOf(statsProvider.getTimer("fooTimer", StatsOptions.TIME_SERIES_ONLY), SimpleStats.class); }
@Test public void statsOptions_Default() throws Exception{ assertInstanceOf(statsProvider.getTimer("fooTimer", StatsOptions.DEFAULT), CompositeStats.class); }