Class NettyRequestMetrics
java.lang.Object
software.amazon.awssdk.http.nio.netty.internal.NettyRequestMetrics
Utilities for collecting and publishing request-level metrics.
-
Method Summary
Modifier and TypeMethodDescriptionstatic void
ifMetricsAreEnabled
(MetricCollector metrics, Consumer<MetricCollector> metricsConsumer) static void
measureTimeTaken
(io.netty.util.concurrent.Future<?> future, Consumer<Duration> onDone) Measure the time taken for aFuture
to complete.static boolean
metricsAreEnabled
(MetricCollector metricCollector) Determine whether metrics are enabled, based on the provided metric collector.static void
publishHttp2StreamMetrics
(MetricCollector metricCollector, io.netty.channel.Channel channel) Publish stream metrics for the provided stream channel to the provided collector.
-
Method Details
-
metricsAreEnabled
Determine whether metrics are enabled, based on the provided metric collector. -
ifMetricsAreEnabled
public static void ifMetricsAreEnabled(MetricCollector metrics, Consumer<MetricCollector> metricsConsumer) -
publishHttp2StreamMetrics
public static void publishHttp2StreamMetrics(MetricCollector metricCollector, io.netty.channel.Channel channel) Publish stream metrics for the provided stream channel to the provided collector. This should only be invoked after the stream has been initialized. If the stream is not initialized when this is invoked, an exception will be thrown. -
measureTimeTaken
public static void measureTimeTaken(io.netty.util.concurrent.Future<?> future, Consumer<Duration> onDone) Measure the time taken for aFuture
to complete. Does NOT differentiate between success/failure.
-