Skip to content

Commit

Permalink
chore(storage): reduce state store metrics report bucket (#12879)
Browse files Browse the repository at this point in the history
  • Loading branch information
Li0k authored Oct 17, 2023
1 parent e995ea0 commit fcc2469
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
6 changes: 5 additions & 1 deletion src/storage/src/monitor/hummock_state_store_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down Expand Up @@ -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();
Expand Down
10 changes: 7 additions & 3 deletions src/storage/src/monitor/monitored_storage_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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();
Expand All @@ -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();
Expand Down

0 comments on commit fcc2469

Please sign in to comment.