DFSOpsCountStatistics extends StorageStatistics { @Override public void reset() { for (AtomicLong count : opsCount.values()) { count.set(0); } } DFSOpsCountStatistics(); void incrementOpCounter(OpType op); @Override String getScheme(); @Override Iterator<LongStatistic> getLongStatistics(); @Override Long getLong(String key); @Override boolean isTracked(String key); @Override void reset(); static final String NAME; }
@Test public void testReset() { statistics.reset(); for (OpType opType : OpType.values()) { expectedOpsCountMap.get(opType).set(0); } final Iterator<LongStatistic> iter = statistics.getLongStatistics(); while (iter.hasNext()) { final LongStatistic longStat = iter.next(); assertEquals(0, longStat.getValue()); } incrementOpsCountByRandomNumbers(); verifyStatistics(); }