@Override public void start() { MetricsService service = MetricsService.create(vertx); JsonObject metrics = service.getMetricsSnapshot(vertx.eventBus()); if (metrics != null) { vertx.eventBus().publish("metrics", metrics);
/** * Will return the metrics that begins with the <code>baseName</code>, null if no metrics is available.<p/> * * Note: in the case of scaled servers, the JsonObject returns an aggregation of the metrics as the * dropwizard backend reports to a single server. * @param baseName * @return the map of metrics where the key is the name of the metric and the value is the json data representing that metric */ public JsonObject getMetricsSnapshot(String baseName) { JsonObject ret = delegate.getMetricsSnapshot(baseName); return ret; }
@Override public double getInstantThroughput() { return metric.getValue(); } }
@Override public MetricsOptions newOptions(JsonObject jsonObject) { return jsonObject == null ? new DropwizardMetricsOptions() : new DropwizardMetricsOptions(jsonObject); } }
/** * Set whether JMX will be enabled on the Vert.x instance. * * @param jmxEnabled true if JMX enabled, or false if not. * @return a reference to this, so the API can be used fluently */ public DropwizardMetricsOptions setJmxEnabled(boolean jmxEnabled) { this.jmxEnabled = jmxEnabled; if (jmxEnabled) { setEnabled(true); } return this; }
protected ThroughputMeter throughputMeter(String... names) { try { return RegistryHelper.throughputMeter(registry, nameOf(names)); } catch (Exception e) { return new ThroughputMeter(); } }
protected ThroughputTimer throughputTimer(String... names) { try { return RegistryHelper.throughputTimer(registry, nameOf(names)); } catch (Exception e) { return new ThroughputTimer(); } }
/** * @return the known metrics names by this service */ public Set<String> metricsNames() { Set<String> ret = delegate.metricsNames(); return ret; }
/** * @param measured the measure object * @return the base name of the measured object */ public String getBaseName(io.vertx.rxjava.core.metrics.Measured measured) { String ret = delegate.getBaseName(measured.getDelegate()); return ret; }
/** * @return a JSON representation of these options */ @Override public JsonObject toJson() { JsonObject json = new JsonObject(); DropwizardMetricsOptionsConverter.toJson(this, json); return json; } }
@Override public double getInstantThroughput() { return metric.getValue(); } }
/** * Will return the metrics that begins with the <code>baseName</code>, null if no metrics is available.<p/> * * Note: in the case of scaled servers, the JsonObject returns an aggregation of the metrics as the * dropwizard backend reports to a single server. * @param baseName * @return the map of metrics where the key is the name of the metric and the value is the json data representing that metric */ public JsonObject getMetricsSnapshot(String baseName) { JsonObject ret = delegate.getMetricsSnapshot(baseName); return ret; }
/** * @return the known metrics names by this service */ public Set<String> metricsNames() { Set<String> ret = delegate.metricsNames(); return ret; }
/** * @param measured the measure object * @return the base name of the measured object */ public String getBaseName(io.vertx.rxjava.core.metrics.Measured measured) { String ret = delegate.getBaseName(measured.getDelegate()); return ret; }
public static void toJson(DropwizardMetricsOptions obj, JsonObject json) { toJson(obj, json.getMap()); }
/** * Will return the metrics that correspond with the <code>measured</code> object, null if no metrics is available.<p/> * * Note: in the case of scaled servers, the JsonObject returns an aggregation of the metrics as the * dropwizard backend reports to a single server. * @param measured * @return the map of metrics where the key is the name of the metric (excluding the base name unless for the Vert.x object) and the value is the json data representing that metric */ public JsonObject getMetricsSnapshot(io.vertx.rxjava.core.metrics.Measured measured) { JsonObject ret = delegate.getMetricsSnapshot(measured.getDelegate()); return ret; }
/** * Will return the metrics that correspond with the <code>measured</code> object, null if no metrics is available.<p/> * * Note: in the case of scaled servers, the JsonObject returns an aggregation of the metrics as the * dropwizard backend reports to a single server. * @param measured * @return the map of metrics where the key is the name of the metric (excluding the base name unless for the Vert.x object) and the value is the json data representing that metric */ public JsonObject getMetricsSnapshot(io.vertx.rxjava.core.metrics.Measured measured) { JsonObject ret = delegate.getMetricsSnapshot(measured.getDelegate()); return ret; }
public static java.util.Map<String, Object> getMetricsSnapshot(io.vertx.ext.dropwizard.MetricsService j_receiver, io.vertx.core.metrics.Measured measured) { return io.vertx.core.impl.ConversionHelper.fromJsonObject(j_receiver.getMetricsSnapshot(measured)); } public static java.util.Map<String, Object> getMetricsSnapshot(io.vertx.ext.dropwizard.MetricsService j_receiver, java.lang.String baseName) {
public static java.util.Map<String, Object> getMetricsSnapshot(io.vertx.ext.dropwizard.MetricsService j_receiver, java.lang.String baseName) { return io.vertx.core.impl.ConversionHelper.fromJsonObject(j_receiver.getMetricsSnapshot(baseName)); } }