@Test public void testClear() { Collector g = Gauge.build().name("g").help("h").register(registry); Collector c = Counter.build().name("c").help("h").register(registry); List<Collector.MetricFamilySamples> mfs = Collections.list(registry.metricFamilySamples()); assertEquals(2, mfs.size()); registry.clear(); mfs = Collections.list(registry.metricFamilySamples()); assertEquals(0, mfs.size()); }
public void clear() { synchronized (namesCollectorsLock) { collectorsToNames.clear(); namesToCollectors.clear(); } }
CollectorRegistry { public void clear() { synchronized (namesCollectorsLock) { collectorsToNames.clear(); namesToCollectors.clear(); } } }
CollectorRegistry { public void clear() { synchronized (namesCollectorsLock) { collectorsToNames.clear(); namesToCollectors.clear(); } } CollectorRegistry();  CollectorRegistry(boolean autoDescribe); }
CollectorRegistry { public void clear() { synchronized (namesCollectorsLock) { collectorsToNames.clear(); namesToCollectors.clear(); } } CollectorRegistry();  CollectorRegistry(boolean autoDescribe); void register(Collector m); void unregister(Collector m); void clear(); Enumeration<Collector.MetricFamilySamples> metricFamilySamples(); Enumeration<Collector.MetricFamilySamples> filteredMetricFamilySamples(Set<String> includedNames); Double getSampleValue(String name); Double getSampleValue(String name, String[] labelNames, String[] labelValues); }
CollectorRegistry { public void clear() { synchronized (namesCollectorsLock) { collectorsToNames.clear(); namesToCollectors.clear(); } } CollectorRegistry();  CollectorRegistry(boolean autoDescribe); void register(Collector m); void unregister(Collector m); void clear(); Enumeration<Collector.MetricFamilySamples> metricFamilySamples(); Enumeration<Collector.MetricFamilySamples> filteredMetricFamilySamples(Set<String> includedNames); Double getSampleValue(String name); Double getSampleValue(String name, String[] labelNames, String[] labelValues); static final CollectorRegistry defaultRegistry; }