@Test public void testActiveReservoir() { Metrics.removeActiveReservoirMatching(ActiveReservoirRecordFilter.ALL); assertEquals(0, Metrics.getActiveReservoirs().size()); int n = 10; for (int i = 0; i < n; i++) { Metrics.register("ActiveReservoir-" + i, new StubReservoir()); } assertEquals(n, Metrics.getActiveReservoirs().size()); String name = "test2"; ActiveReservoir activeReservoir = new StubReservoir(); Metrics.register(name, activeReservoir); assertEquals(activeReservoir, Metrics.activeReservoir(name)); assertTrue(Metrics.removeActiveReservoir(name)); assertFalse(Metrics.removeActiveReservoir(name)); }
public ActiveReservoir activeReservoir(String name) { return getOrAddActiveReservoir(name); }
MetricsSystem extends MetricRegistry { public ActiveReservoir activeReservoir(String name) { return getOrAddActiveReservoir(name); } }
MetricsSystem extends MetricRegistry { public ActiveReservoir activeReservoir(String name) { return getOrAddActiveReservoir(name); } private  MetricsSystem(); }
MetricsSystem extends MetricRegistry { public ActiveReservoir activeReservoir(String name) { return getOrAddActiveReservoir(name); } private  MetricsSystem(); void shutdown(); ActiveReservoir activeReservoir(String name); ActiveReservoir register(String name, ActiveReservoir activeReservoir); boolean removeActiveReservoir(String name); void removeActiveReservoirMatching(ActiveReservoirRecordFilter filter); SortedMap<String, ActiveReservoir> getActiveReservoirs(); SortedMap<String, ActiveReservoir> getActiveReservoirs(ActiveReservoirRecordFilter filter); }
MetricsSystem extends MetricRegistry { public ActiveReservoir activeReservoir(String name) { return getOrAddActiveReservoir(name); } private  MetricsSystem(); void shutdown(); ActiveReservoir activeReservoir(String name); ActiveReservoir register(String name, ActiveReservoir activeReservoir); boolean removeActiveReservoir(String name); void removeActiveReservoirMatching(ActiveReservoirRecordFilter filter); SortedMap<String, ActiveReservoir> getActiveReservoirs(); SortedMap<String, ActiveReservoir> getActiveReservoirs(ActiveReservoirRecordFilter filter); static final MetricsSystem Metrics; }