Class MetricUtils
java.lang.Object
software.amazon.awssdk.core.internal.util.MetricUtils
-
Method Summary
Modifier and TypeMethodDescriptionstatic OptionalLongstatic OptionalLongstatic doublebytesPerSec(long totalBytes, long nanoStart, long nanoEnd) static voidcollectHttpMetrics(MetricCollector metricCollector, SdkHttpFullResponse httpResponse) static voidcollectServiceEndpointMetrics(MetricCollector metricCollector, SdkHttpFullRequest httpRequest) Collect the SERVICE_ENDPOINT metric for this request.static MetricCollectorstatic MetricCollectormeasureDuration(Supplier<T> c) Measure the duration of the given callable.Measure the duration of the given callable.measureDurationUnsafe(Callable<T> c, long startTime) Measure the duration of the given callable, using the provided time as the basis.static <T> CompletableFuture<T> reportDuration(Supplier<CompletableFuture<T>> c, MetricCollector metricCollector, SdkMetric<Duration> metric) Report a duration metric of the givenCompletableFuturesupplier.static longstatic OptionalLong
-
Method Details
-
measureDuration
-
reportDuration
public static <T> CompletableFuture<T> reportDuration(Supplier<CompletableFuture<T>> c, MetricCollector metricCollector, SdkMetric<Duration> metric) Report a duration metric of the givenCompletableFuturesupplier.- Parameters:
c- The callable to measure.metricCollector- The MetricCollector where the metric is to be reported.metric- The metric to be reported.- Returns:
- A
Paircontaining the result ofcand the duration.
-
measureDurationUnsafe
-
measureDurationUnsafe
-
collectServiceEndpointMetrics
public static void collectServiceEndpointMetrics(MetricCollector metricCollector, SdkHttpFullRequest httpRequest) Collect the SERVICE_ENDPOINT metric for this request. -
collectHttpMetrics
public static void collectHttpMetrics(MetricCollector metricCollector, SdkHttpFullResponse httpResponse) -
createAttemptMetricsCollector
-
createHttpMetricsCollector
-
apiCallAttemptStartNanoTime
-
resetApiCallAttemptStartNanoTime
-
apiCallAttemptResponseBytesRead
-
responseHeadersReadEndNanoTime
-
bytesPerSec
public static double bytesPerSec(long totalBytes, long nanoStart, long nanoEnd)
-