public final class LoggingMetricPublisher extends Object implements MetricPublisher
MetricPublisherthat writes all published metrics to the logs at the INFO level under the
|Modifier and Type||Method and Description|
Notify the publisher of new metric data.
public static LoggingMetricPublisher create()
public void publish(MetricCollection metricCollection)
metricCollectioninstance if it no longer needs it. Implementations are strongly encouraged to complete any further aggregation and publishing of metrics in an asynchronous manner to avoid blocking the calling thread.
With the exception of a
invocations of this method must return normally. This
is to ensure that callers of the publisher can safely assume that even
in situations where an error happens during publishing that it will not
interrupt the calling thread.
public void close()
Important: Implementations must block the calling thread until all pending metrics are published and any resources acquired have been freed.