@Test public void testGetCompositeCounter() { Registry r = NoopRegistry.INSTANCE; List<Registry> list = new ArrayList<Registry>(); list.add(r); CompositeCounter counter = new CompositeCounter(r.createId("xx"), list); counter.dec(1); counter.dec(); counter.inc(2); counter.inc(); Assert.assertEquals(0, counter.count()); }
public void add(MetricRegistry registry) { Assert.checkArg(!(registry instanceof CompositeRegistry), String.format("registry: %s can not be a CompositeRegistry!", registry)); registries.add(registry); }
CompositeRegistry extends MetricRegistry { public void add(MetricRegistry registry) { Assert.checkArg(!(registry instanceof CompositeRegistry), String.format("registry: %s can not be a CompositeRegistry!", registry)); registries.add(registry); } }
CompositeRegistry extends MetricRegistry { public void add(MetricRegistry registry) { Assert.checkArg(!(registry instanceof CompositeRegistry), String.format("registry: %s can not be a CompositeRegistry!", registry)); registries.add(registry); } CompositeRegistry(Clock clock); }
CompositeRegistry extends MetricRegistry { public void add(MetricRegistry registry) { Assert.checkArg(!(registry instanceof CompositeRegistry), String.format("registry: %s can not be a CompositeRegistry!", registry)); registries.add(registry); } CompositeRegistry(Clock clock); @Override void registerExtendedMetrics(); Collection<Registry> getRegistries(); void add(MetricRegistry registry); void remove(Registry registry); void clear(); @Override Gauge<T> gauge(Id id, Gauge<T> gauge); @Override void removeMetric(Id id); @Override Info info(Id id, Y info); @Override void register(Metric metric); @Override Counter counter(Id id); @Override DistributionSummary distributionSummary(Id id); @Override Timer timer(Id id); @Override MixinMetric mixinMetric(Id id); @Override X get(Id id); @Override Iterator<Metric> iterator(); }
CompositeRegistry extends MetricRegistry { public void add(MetricRegistry registry) { Assert.checkArg(!(registry instanceof CompositeRegistry), String.format("registry: %s can not be a CompositeRegistry!", registry)); registries.add(registry); } CompositeRegistry(Clock clock); @Override void registerExtendedMetrics(); Collection<Registry> getRegistries(); void add(MetricRegistry registry); void remove(Registry registry); void clear(); @Override Gauge<T> gauge(Id id, Gauge<T> gauge); @Override void removeMetric(Id id); @Override Info info(Id id, Y info); @Override void register(Metric metric); @Override Counter counter(Id id); @Override DistributionSummary distributionSummary(Id id); @Override Timer timer(Id id); @Override MixinMetric mixinMetric(Id id); @Override X get(Id id); @Override Iterator<Metric> iterator();  }