DefaultStatisticsProvider implements StatisticsProvider { @Override public MeterStats getMeter(String name, StatsOptions options) { return getStats(name, true, SimpleStats.Type.METER, 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 meter() throws Exception { MeterStats meterStats = statsProvider.getMeter("test", StatsOptions.DEFAULT); assertNotNull(meterStats); meterStats.mark(); assertEquals(1, statsImpl(statsProvider).getCounter("test", true).get()); assertTrue(getRegisteredTimeSeries(statsProvider).contains("test")); }
@Test public void metricOnly() throws Exception{ MeterStats meterStats = statsProvider.getMeter("test", StatsOptions.METRICS_ONLY); assertFalse(getRegisteredTimeSeries(statsProvider).contains("test")); }