DFSOpsCountStatistics extends StorageStatistics { @Override public Iterator<LongStatistic> getLongStatistics() { return new LongIterator(); } 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 testGetLongStatistics() { short iterations = 0; final Iterator<LongStatistic> iter = statistics.getLongStatistics(); while (iter.hasNext()) { final LongStatistic longStat = iter.next(); assertNotNull(longStat); final OpType opType = OpType.fromSymbol(longStat.getName()); assertNotNull(opType); assertTrue(expectedOpsCountMap.containsKey(opType)); assertEquals(expectedOpsCountMap.get(opType).longValue(), longStat.getValue()); iterations++; } assertEquals(OpType.values().length, iterations); }