MetricsStatsCounter implements StatsCounter { @Override public void recordLoadFailure(long loadTime) { loadFailure.update(loadTime, TimeUnit.NANOSECONDS); totalLoadTime.add(loadTime); } MetricsStatsCounter(MetricRegistry registry, String metricsPrefix); @Override void recordHits(int count); @Override void recordMisses(int count); @Override void recordLoadSuccess(long loadTime); @Override void recordLoadFailure(long loadTime); @Override @SuppressWarnings("deprecation") void recordEviction(); @Override void recordEviction(int weight); @Override void recordEviction(@NonNegative int weight, RemovalCause cause); @Override CacheStats snapshot(); @Override String toString();  }
@Test public void loadFailure() { stats.recordLoadFailure(256); assertThat(registry.timer(PREFIX + ".loads-failure").getCount()).isEqualTo(1); }