Skip to content

Commit

Permalink
fix metrics
Browse files Browse the repository at this point in the history
Signed-off-by: Little-Wallace <[email protected]>
  • Loading branch information
Little-Wallace committed Mar 31, 2023
1 parent d05b6f0 commit ce99a4a
Show file tree
Hide file tree
Showing 6 changed files with 9 additions and 36 deletions.
2 changes: 1 addition & 1 deletion grafana/risingwave-dashboard.dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -645,7 +645,7 @@ def section_compaction(outer_panels):
[90, "max"],
),
panels.target(
f"histogram_quantile(0.99, sum(rate({metric('compute_apply_version_duration_bucket')}[$__rate_interval])) by (le, instance))",
f"histogram_quantile(0.99, sum(rate({metric('compute_refill_cache_duration_bucket')}[$__rate_interval])) by (le, instance))",
"compute_apply_version_duration_p99 - {{instance}}",
),
panels.target(
Expand Down
2 changes: 1 addition & 1 deletion grafana/risingwave-dashboard.json

Large diffs are not rendered by default.

29 changes: 0 additions & 29 deletions src/config/config.toml

This file was deleted.

2 changes: 2 additions & 0 deletions src/storage/src/hummock/event_handler/cache_refill_policy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ impl CacheRefillPolicy {
if self.max_preload_wait_time_mill > 0 {
let policy = self.clone();
let handle = tokio::spawn(async move {
let timer = policy.metrics.refill_cache_duration.start_timer();
let mut preload_count = 0;
let stats = StoreLocalStatistic::default();
let mut flatten_reqs = Vec::new();
Expand Down Expand Up @@ -73,6 +74,7 @@ impl CacheRefillPolicy {
}
policy.metrics.preload_io_count.inc_by(preload_count as u64);
let _ = try_join_all(flatten_reqs).await;
timer.observe_duration();
});
let _ = tokio::time::timeout(
Duration::from_millis(self.max_preload_wait_time_mill),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ impl HummockEventHandler {
);
let cache_fill_policy = Arc::new(CacheRefillPolicy::new(
sstable_store,
metrics.clone(),
metrics,
max_preload_wait_time_mill,
));

Expand Down
8 changes: 4 additions & 4 deletions src/storage/src/monitor/compactor_metrics.rs
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ pub struct CompactorMetrics {
pub write_build_l0_bytes: GenericCounter<AtomicU64>,
pub sstable_distinct_epoch_count: Histogram,
pub preload_io_count: GenericCounter<AtomicU64>,
pub apply_version_duration: Histogram,
pub refill_cache_duration: Histogram,
}

impl CompactorMetrics {
Expand Down Expand Up @@ -85,11 +85,11 @@ impl CompactorMetrics {
let get_table_id_total_time_duration =
register_histogram_with_registry!(opts, registry).unwrap();
let opts = histogram_opts!(
"compute_apply_version_duration",
"compute_refill_cache_duration",
"Total time of compact that have been issued to state store",
exponential_buckets(0.001, 1.6, 20).unwrap() // max 520s
);
let apply_version_duration = register_histogram_with_registry!(opts, registry).unwrap();
let refill_cache_duration = register_histogram_with_registry!(opts, registry).unwrap();
let opts = histogram_opts!(
"compactor_remote_read_time",
"Total time of operations which read from remote storage when enable prefetch",
Expand Down Expand Up @@ -244,7 +244,7 @@ impl CompactorMetrics {
write_build_l0_bytes,
sstable_distinct_epoch_count,
preload_io_count,
apply_version_duration,
refill_cache_duration,
}
}

Expand Down

0 comments on commit ce99a4a

Please sign in to comment.