@Test public void testAutoDescribeDisabledByDefault() { CollectorRegistry r = new CollectorRegistry(); new MyCollector().register(r); new MyCollector().register(r); }
public void register(Collector m) { List<String> names = collectorNames(m); synchronized (namesCollectorsLock) { for (String name : names) { if (namesToCollectors.containsKey(name)) { throw new IllegalArgumentException("Collector already registered that provides name: " + name); } } for (String name : names) { namesToCollectors.put(name, m); } collectorsToNames.put(m, names); } }
CollectorRegistry { public void register(Collector m) { List<String> names = collectorNames(m); synchronized (namesCollectorsLock) { for (String name : names) { if (namesToCollectors.containsKey(name)) { throw new IllegalArgumentException("Collector already registered that provides name: " + name); } } for (String name : names) { namesToCollectors.put(name, m); } collectorsToNames.put(m, names); } } }
CollectorRegistry { public void register(Collector m) { List<String> names = collectorNames(m); synchronized (namesCollectorsLock) { for (String name : names) { if (namesToCollectors.containsKey(name)) { throw new IllegalArgumentException("Collector already registered that provides name: " + name); } } for (String name : names) { namesToCollectors.put(name, m); } collectorsToNames.put(m, names); } } CollectorRegistry();  CollectorRegistry(boolean autoDescribe); }
CollectorRegistry { public void register(Collector m) { List<String> names = collectorNames(m); synchronized (namesCollectorsLock) { for (String name : names) { if (namesToCollectors.containsKey(name)) { throw new IllegalArgumentException("Collector already registered that provides name: " + name); } } for (String name : names) { namesToCollectors.put(name, m); } collectorsToNames.put(m, names); } } 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 register(Collector m) { List<String> names = collectorNames(m); synchronized (namesCollectorsLock) { for (String name : names) { if (namesToCollectors.containsKey(name)) { throw new IllegalArgumentException("Collector already registered that provides name: " + name); } } for (String name : names) { namesToCollectors.put(name, m); } collectorsToNames.put(m, names); } } 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; }