assertEquals(0.0, stats.averageLoadPenalty());
assertEquals(0, stats.evictionCount());
}
public void testSingleSimpleStats() {
StatsCounter counter = new SimpleStatsCounter();
for (int i = 0; i < 11; i++) {
counter.recordHits(1);
}
for (int i = 0; i < 13; i++) {
counter.recordLoadSuccess(i);
}
for (int i = 0; i < 17; i++) {
counter.recordLoadException(i);
}
for (int i = 0; i < 23; i++) {
counter.recordMisses(1);
}
for (int i = 0; i < 27; i++) {
counter.recordEviction();
}
CacheStats stats = counter.snapshot();
int requestCount = 11 + 23;
assertEquals(requestCount, stats.requestCount());
assertEquals(11, stats.hitCount());
assertEquals(11.0 / requestCount, stats.hitRate());
int missCount = 23;