Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: fix comment and metrics #12331

Merged
merged 2 commits into from
Sep 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion src/storage/src/hummock/event_handler/refiller.rs
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ pub struct CacheRefillMetrics {

pub data_refill_filtered_total: GenericCounter<AtomicU64>,
pub data_refill_attempts_total: GenericCounter<AtomicU64>,
pub data_refill_started_total: GenericCounter<AtomicU64>,
pub meta_refill_attempts_total: GenericCounter<AtomicU64>,

pub refill_queue_total: IntGauge,
Expand Down Expand Up @@ -83,6 +84,9 @@ impl CacheRefillMetrics {
let data_refill_attempts_total = refill_total
.get_metric_with_label_values(&["data", "attempts"])
.unwrap();
let data_refill_started_total = refill_total
.get_metric_with_label_values(&["data", "started"])
.unwrap();
let meta_refill_attempts_total = refill_total
.get_metric_with_label_values(&["meta", "attempts"])
.unwrap();
Expand All @@ -102,6 +106,7 @@ impl CacheRefillMetrics {
meta_refill_success_duration,
data_refill_filtered_total,
data_refill_attempts_total,
data_refill_started_total,
meta_refill_attempts_total,
refill_queue_total,
}
Expand Down Expand Up @@ -290,9 +295,12 @@ impl CacheRefillTask {
let mut tasks = vec![];
for sst_info in &holders {
let task = async move {
GLOBAL_CACHE_REFILL_METRICS.data_refill_attempts_total.inc();

let permit = context.concurrency.acquire().await.unwrap();

GLOBAL_CACHE_REFILL_METRICS.data_refill_attempts_total.inc();
GLOBAL_CACHE_REFILL_METRICS.data_refill_started_total.inc();

match context
.sstable_store
.fill_data_file_cache(sst_info.value())
Expand Down
2 changes: 1 addition & 1 deletion src/storage/src/hummock/sstable/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -326,7 +326,7 @@ impl BlockMeta {
/// Format:
///
/// ```plain
/// | offset (4B) | len (4B) | smallest key len (4B) | smallest key |
/// | offset (4B) | len (4B) | uncompressed size (4B) | smallest key len (4B) | smallest key |
/// ```
pub fn encode(&self, buf: &mut Vec<u8>) {
buf.put_u32_le(self.offset);
Expand Down
Loading