public final class LoggingMetricPublisher extends Object implements MetricPublisher
MetricPublisher that writes all published metrics to the logs at the INFO level under the
software.amazon.awssdk.metrics.LoggingMetricPublisher namespace.
NOTE: This is a Preview API and is subject to change so it should not be used in production.| Modifier and Type | Method and Description |
|---|---|
void |
close() |
static LoggingMetricPublisher |
create() |
void |
publish(MetricCollection metricCollection)
Notify the publisher of new metric data.
|
public static LoggingMetricPublisher create()
public void publish(MetricCollection metricCollection)
MetricPublishermetricCollection instance 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 null metricCollection, all
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.
publish in interface MetricPublishermetricCollection - The collection of metrics.public void close()
MetricPublisherImportant: Implementations must block the calling thread until all pending metrics are published and any resources acquired have been freed.
close in interface AutoCloseableclose in interface MetricPublisherclose in interface SdkAutoCloseableCopyright © 2020. All rights reserved.