@Override public double getInstantThroughput() { return metric.getValue(); } }
@Override public void messageSent(String address, boolean publish, boolean local, boolean remote) { if (!isInternal(address)) { if (publish) { publishedMessages.mark(); if (local) { publishedLocalMessages.mark(); } else { publishedRemoteMessages.mark(); } } else { sentMessages.mark(); if (local) { sentLocalMessages.mark(); } else { sentRemoteMessages.mark(); } } } }
protected ThroughputMeter throughputMeter(String... names) { try { return RegistryHelper.throughputMeter(registry, nameOf(names)); } catch (Exception e) { return new ThroughputMeter(); } }
@Override public void messageReceived(String address, boolean publish, boolean local, int handlers) { if (!isInternal(address)) { receivedMessages.mark(); if (local) { receivedLocalMessages.mark(); } else { receivedRemoteMessages.mark(); } if (handlers > 0) { deliveredMessages.mark(); if (local) { deliveredLocalMessages.mark(); } else { deliveredRemoteMessages.mark(); } } } }
private static JsonObject toJson(Meter meter, TimeUnit rateUnit) { JsonObject json = new JsonObject(); json.put("type", "meter"); // if (meter instanceof ThroughputMeter) { ThroughputMeter throughput = (ThroughputMeter) meter; json.put("oneSecondRate", throughput.getValue()); } // Meter populateMetered(json, meter, rateUnit); return json; }
responses[responseStatus - 1].mark();