From 28db496b69b7ddd1d5d47c21baa533a97e7539fe Mon Sep 17 00:00:00 2001 From: Shichao Nie Date: Mon, 25 Dec 2023 16:51:29 +0800 Subject: [PATCH] feat(s3stream): set explicit boundaries for network queue time hist Signed-off-by: Shichao Nie --- .../automq/stream/s3/metrics/S3StreamMetricsConstant.java | 2 +- .../automq/stream/s3/metrics/S3StreamMetricsManager.java | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsConstant.java b/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsConstant.java index 485d5e0d6..9edf37463 100644 --- a/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsConstant.java +++ b/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsConstant.java @@ -39,7 +39,7 @@ public class S3StreamMetricsConstant { "64MB", "128MB", "inf"}; - public static final List OPERATION_LATENCY_BOUNDARIES = List.of( + public static final List LATENCY_BOUNDARIES = List.of( TimeUnit.MICROSECONDS.toNanos(1), TimeUnit.MICROSECONDS.toNanos(10), TimeUnit.MICROSECONDS.toNanos(100), diff --git a/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsManager.java b/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsManager.java index acd69a462..11048ad1a 100644 --- a/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsManager.java +++ b/s3stream/src/main/java/com/automq/stream/s3/metrics/S3StreamMetricsManager.java @@ -95,7 +95,7 @@ public static void initMetrics(Meter meter, String prefix) { .setDescription("Operations latency") .setUnit("nanoseconds") .ofLongs() - .setExplicitBucketBoundariesAdvice(S3StreamMetricsConstant.OPERATION_LATENCY_BOUNDARIES) + .setExplicitBucketBoundariesAdvice(S3StreamMetricsConstant.LATENCY_BOUNDARIES) .build(); objectNumInTotal = meter.counterBuilder(prefix + S3StreamMetricsConstant.OBJECT_COUNT_METRIC_NAME) .setDescription("Objects count") @@ -104,7 +104,7 @@ public static void initMetrics(Meter meter, String prefix) { .setDescription("Objects stage cost") .setUnit("nanoseconds") .ofLongs() - .setExplicitBucketBoundariesAdvice(S3StreamMetricsConstant.OPERATION_LATENCY_BOUNDARIES) + .setExplicitBucketBoundariesAdvice(S3StreamMetricsConstant.LATENCY_BOUNDARIES) .build(); objectUploadSize = meter.histogramBuilder(prefix + S3StreamMetricsConstant.OBJECT_UPLOAD_SIZE_METRIC_NAME) .setDescription("Objects upload size") @@ -146,11 +146,13 @@ public static void initMetrics(Meter meter, String prefix) { .setDescription("Network inbound limiter queue time") .setUnit("nanoseconds") .ofLongs() + .setExplicitBucketBoundariesAdvice(S3StreamMetricsConstant.LATENCY_BOUNDARIES) .build(); networkOutboundLimiterQueueTime = meter.histogramBuilder(prefix + S3StreamMetricsConstant.NETWORK_OUTBOUND_LIMITER_QUEUE_TIME_METRIC_NAME) .setDescription("Network outbound limiter queue time") .setUnit("nanoseconds") .ofLongs() + .setExplicitBucketBoundariesAdvice(S3StreamMetricsConstant.LATENCY_BOUNDARIES) .build(); allocateByteBufSize = meter.histogramBuilder(prefix + S3StreamMetricsConstant.ALLOCATE_BYTE_BUF_SIZE_METRIC_NAME) .setDescription("Allocate byte buf size")