From fcc2469364b376c1aa30b605f27790d2584b4e61 Mon Sep 17 00:00:00 2001 From: Li0k Date: Tue, 17 Oct 2023 09:19:53 +0800 Subject: [PATCH] chore(storage): reduce state store metrics report bucket (#12879) --- src/storage/src/monitor/hummock_state_store_metrics.rs | 6 +++++- src/storage/src/monitor/monitored_storage_metrics.rs | 10 +++++++--- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/storage/src/monitor/hummock_state_store_metrics.rs b/src/storage/src/monitor/hummock_state_store_metrics.rs index 77043b32ab455..32a741809ed63 100644 --- a/src/storage/src/monitor/hummock_state_store_metrics.rs +++ b/src/storage/src/monitor/hummock_state_store_metrics.rs @@ -81,6 +81,10 @@ impl HummockStateStoreMetrics { pub fn new(registry: &Registry, metric_level: MetricLevel) -> Self { // 10ms ~ max 2.7h let time_buckets = exponential_buckets(0.01, 10.0, 7).unwrap(); + + // 1ms - 100s + let state_store_read_time_buckets = exponential_buckets(0.001, 10.0, 5).unwrap(); + let bloom_filter_true_negative_counts = register_int_counter_vec_with_registry!( "state_store_bloom_filter_true_negative_counts", "Total number of sstables that have been considered true negative by bloom filters", @@ -177,7 +181,7 @@ impl HummockStateStoreMetrics { let opts = histogram_opts!( "state_store_iter_fetch_meta_duration", "Histogram of iterator fetch SST meta time that have been issued to state store", - time_buckets.clone(), + state_store_read_time_buckets.clone(), ); let iter_fetch_meta_duration = register_histogram_vec_with_registry!(opts, &["table_id"], registry).unwrap(); diff --git a/src/storage/src/monitor/monitored_storage_metrics.rs b/src/storage/src/monitor/monitored_storage_metrics.rs index a1517d98918ac..bf2bb181df1fc 100644 --- a/src/storage/src/monitor/monitored_storage_metrics.rs +++ b/src/storage/src/monitor/monitored_storage_metrics.rs @@ -88,10 +88,14 @@ impl MonitoredStorageMetrics { buckets.extend(exponential_buckets(0.001, 2.0, 5).unwrap()); // 1 ~ 16ms. buckets.extend(exponential_buckets(0.05, 4.0, 5).unwrap()); // 0.05 ~ 1.28s. buckets.push(16.0); // 16s + + // 1ms - 100s + let state_store_read_time_buckets = exponential_buckets(0.001, 10.0, 5).unwrap(); + let get_duration_opts = histogram_opts!( "state_store_get_duration", "Total latency of get that have been issued to state store", - buckets.clone(), + state_store_read_time_buckets.clone(), ); let get_duration = register_histogram_vec_with_registry!(get_duration_opts, &["table_id"], registry) @@ -125,7 +129,7 @@ impl MonitoredStorageMetrics { let opts = histogram_opts!( "state_store_iter_init_duration", "Histogram of the time spent on iterator initialization.", - buckets.clone(), + state_store_read_time_buckets.clone(), ); let iter_init_duration = register_histogram_vec_with_registry!(opts, &["table_id"], registry).unwrap(); @@ -138,7 +142,7 @@ impl MonitoredStorageMetrics { let opts = histogram_opts!( "state_store_iter_scan_duration", "Histogram of the time spent on iterator scanning.", - buckets.clone(), + state_store_read_time_buckets.clone(), ); let iter_scan_duration = register_histogram_vec_with_registry!(opts, &["table_id"], registry).unwrap();