DefaultStatisticsProvider implements StatisticsProvider { @Override public TimerStats getTimer(String name, StatsOptions options) { return getStats(name, true, SimpleStats.Type.TIMER, options); } DefaultStatisticsProvider(ScheduledExecutorService executor); @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);  }
@Test public void timer() throws Exception { TimerStats timerStats = statsProvider.getTimer("test", StatsOptions.DEFAULT); assertNotNull(timerStats); timerStats.update(100, TimeUnit.SECONDS); assertEquals(TimeUnit.SECONDS.toMillis(100), statsImpl(statsProvider).getCounter("test", false).get()); assertTrue(getRegisteredTimeSeries(statsProvider).contains("test")); }