@Override public void close() { if (shutdown) { RegistryHelper.shutdown(registry); if (options.getRegistryName() != null) { SharedMetricRegistries.remove(options.getRegistryName()); } } List<HttpClientReporter> reporters; synchronized (this) { reporters = new ArrayList<>(clientReporters.values()); } for (HttpClientReporter reporter : reporters) { reporter.close(); } if (doneHandler != null) { doneHandler.handle(null); } }
/** * Copy constructor * * @param other The other {@link DropwizardMetricsOptions} to copy when creating this */ public DropwizardMetricsOptions(DropwizardMetricsOptions other) { super(other); registryName = other.getRegistryName(); jmxEnabled = other.isJmxEnabled(); jmxDomain = other.getJmxDomain(); configPath = other.getConfigPath(); monitoredEventBusHandlers = new ArrayList<>(other.monitoredEventBusHandlers); monitoredHttpServerUris = new ArrayList<>(other.monitoredHttpServerUris); monitoredHttpClientUris = new ArrayList<>(other.monitoredHttpClientUris); monitoredHttpClientEndpoints = new ArrayList<>(other.monitoredHttpClientEndpoints); metricRegistry = other.getMetricRegistry(); }
public static void toJson(DropwizardMetricsOptions obj, java.util.Map<String, Object> json) { if (obj.getBaseName() != null) { json.put("baseName", obj.getBaseName()); } if (obj.getConfigPath() != null) { json.put("configPath", obj.getConfigPath()); } json.put("enabled", obj.isEnabled()); if (obj.getJmxDomain() != null) { json.put("jmxDomain", obj.getJmxDomain()); } json.put("jmxEnabled", obj.isJmxEnabled()); if (obj.getRegistryName() != null) { json.put("registryName", obj.getRegistryName()); } } }
if (metricsOptions.getRegistryName() != null) { MetricRegistry other = SharedMetricRegistries.add(metricsOptions.getRegistryName(), registry); if (other != null) { registry = other;