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; }
/** * 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; }
/** * 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)); } }
private void publishMetricsSnapshot(HttpServerResponse rep) { rep.headers().set(HttpHeaders.CONTENT_TYPE, CONTENT_JSON); JsonObject o = new JsonObject(); o.put("http_proxy", metricsService.getMetricsSnapshot(METRICS_HTTP_PROXY_FQDN)); o.put("http_remote", metricsService.getMetricsSnapshot(METRICS_HTTP_REMOTE_FQDN)); rep.end(o.toString()); } }
Map<String, Object> histogramMetrics = metrics.getMetricsSnapshot(name) .stream() .filter(e -> ((JsonObject) e.getValue()).getString("type").equals("histogram"))
@Override public void process(CommandProcess process) { String name = process.args().get(0); MetricsService metrics = MetricsService.create(process.vertx()); JsonObject snapshot = metrics.getMetricsSnapshot(name); process.write(snapshot.encodePrettily() + "\n"); process.end(); } }
JsonObject metrics = service.getMetricsSnapshot(vertx); vertx.eventBus().publish("microservice.monitor.metrics", metrics); });