DefaultStatisticsProvider implements StatisticsProvider { @Override public CounterStats getCounterStats(String name, StatsOptions options) { return getStats(name, false, SimpleStats.Type.COUNTER, 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 counter() throws Exception { CounterStats counterStats = statsProvider.getCounterStats("test", StatsOptions.DEFAULT); assertNotNull(counterStats); counterStats.inc(); assertEquals(1, statsImpl(statsProvider).getCounter("test", false).get()); assertTrue(getRegisteredTimeSeries(statsProvider).contains("test")); }