StepCounter extends AbstractMonitor<Number> implements Counter, SpectatorMonitor { @Override public Number getValue(int pollerIndex) { final long n = count.poll(pollerIndex); final double stepSeconds = Pollers.POLLING_INTERVALS[pollerIndex] / 1000.0; return n / stepSeconds; } StepCounter(MonitorConfig config); @VisibleForTesting  StepCounter(MonitorConfig config, Clock clock); @Override void increment(); @Override void increment(long amount); @Override Number getValue(int pollerIndex); long getCount(int pollerIndex); @VisibleForTesting long getCurrentCount(int pollerIndex); @Override void initializeSpectator(TagList tags); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testInitialPollIsZero() { clock.set(time(1)); StepCounter c = newInstance("foo"); assertEquals(c.getValue(1).doubleValue(), 0.0, DELTA); }
@Test public void testHasRightType() throws Exception { assertEquals(newInstance("foo").getConfig().getTags().getValue(DataSourceType.KEY), "NORMALIZED"); }