BasicCounter extends AbstractMonitor<Number> implements Counter, SpectatorMonitor { @Override public Number getValue(int pollerIdx) { return count.get(); } BasicCounter(MonitorConfig config); @Override void increment(); @Override void increment(long amount); @Override Number getValue(int pollerIdx); @Override void initializeSpectator(TagList tags); @Override boolean equals(Object obj); @Override int hashCode(); @Override String toString();  }
@Test public void testHasCounterTag() throws Exception { Tag type = newInstance("foo").getConfig().getTags().getTag(DataSourceType.KEY); assertEquals(type.getValue(), "COUNTER"); }
@Test public void testGetValue() throws Exception { BasicCounter c = newInstance("foo"); assertEquals(c.getValue().longValue(), 0L); c.increment(); assertEquals(c.getValue().longValue(), 1L); c.increment(13); assertEquals(c.getValue().longValue(), 14L); }