@Override public Metric getCommandsMetric() { return metricFactory.generate(LMTP_COMMANDS); } }
@Override public Metric generate(String name) { return new NoopMetric(); }
@Override public void service(Mail mail) throws MessagingException { metric.increment(); }
default <T> T runPublishingTimerMetric(String name, Supplier<T> operation) { TimeMetric timer = timer(name); try { return operation.get(); } finally { timer.stopAndPublish(); } }
public LMTPProtocolHandlerChain() { super(new NoopMetricFactory()); }
@Override public void handle(Request request, Response response) throws Exception { if (request.attribute(MetricPreFilter.METRICS) instanceof TimeMetric) { TimeMetric timeMetric = request.attribute(MetricPreFilter.METRICS); timeMetric.stopAndPublish(); } } }
@Override public InputStream read(BlobId blobId) { return metricFactory .runPublishingTimerMetric(READ_TIMER_NAME, () -> blobStoreImpl.read(blobId)); } }
@Override public TimeMetric timer(String name) { return new NoopTimeMetric(); }
default <T> CompletableFuture<T> runPublishingTimerMetric(String name, CompletableFuture<T> future) { TimeMetric timer = timer(name); return future.whenComplete((result, throwable) -> timer.stopAndPublish()); } }
public LMTPProtocolHandlerChain(boolean addDefault) { super(new NoopMetricFactory(), addDefault); }
@Override public Metric getConnectionMetric() { return metricFactory.generate(LMTP_CONNECTIONS); }
@Override public CompletableFuture<BlobId> save(InputStream data) { return metricFactory .runPublishingTimerMetric(SAVE_INPUT_STREAM_TIMER_NAME, blobStoreImpl.save(data)); }
@Override public TimeMetric timer(String name) { return new NoopTimeMetric(); }
@Override public Metric generate(String name) { return new NoopMetric(); }
default <T> T runPublishingTimerMetric(String name, Supplier<T> operation) { TimeMetric timer = timer(name); try { return operation.get(); } finally { timer.stopAndPublish(); } }
public LMTPProtocolHandlerChain(Hook... hooks) throws WiringException { super(new NoopMetricFactory(), hooks); }
public TestableDNSServer() { super(new NoopMetricFactory()); }
public TestableDNSServer() { super(new NoopMetricFactory()); }