DoubleCounter extends AbstractMonitor<Number> implements NumericMonitor<Number>, SpectatorMonitor { void increment(double amount) { spectatorCounter.add(amount); if (amount >= 0.0) { for (int i = 0; i < Pollers.NUM_POLLERS; ++i) { add(count.getCurrent(i), amount); } } } DoubleCounter(MonitorConfig config, Clock clock); @Override Number getValue(int pollerIndex); @VisibleForTesting double getCurrentCount(int pollerIndex); @Override void initializeSpectator(TagList tags); @Override String toString(); @Override boolean equals(Object o); @Override int hashCode();  }
@Test public void testIncrement() { assertEquals(Pollers.POLLING_INTERVALS[0], 60000L); DoubleCounter c = newInstance("c"); c.increment(1.0); assertEquals(c.getCurrentCount(0), 1.0); }