List of usage examples for io.vertx.core.metrics MetricsOptions isEnabled
public boolean isEnabled()
From source file:co.runrightfast.vertx.core.impl.VertxServiceImpl.java
License:Apache License
private JsonObject toJsonObject(final MetricsOptions metricsOptions) { if (metricsOptions instanceof DropwizardMetricsOptions) { final DropwizardMetricsOptions dropwizardMetricsOptions = (DropwizardMetricsOptions) metricsOptions; final JsonObject json = new JsonObject().put("enabled", metricsOptions.isEnabled()).put("jmxEnabled", dropwizardMetricsOptions.isJmxEnabled()); toJsonObject(dropwizardMetricsOptions.getMonitoredEventBusHandlers()) .ifPresent(jsonArray -> json.put("MonitoredEventBusHandlers", jsonArray)); toJsonObject(dropwizardMetricsOptions.getMonitoredHttpClientUris()) .ifPresent(jsonArray -> json.put("MonitoredHttpClientUris", jsonArray)); toJsonObject(dropwizardMetricsOptions.getMonitoredHttpServerUris()) .ifPresent(jsonArray -> json.put("MonitoredHttpServerUris", jsonArray)); return json; } else {//from w w w . ja va 2s . c o m return new JsonObject().put("enabled", metricsOptions.isEnabled()); } }