From ab248996a5324c54db8ee52c4e7cf709b1ebf70d Mon Sep 17 00:00:00 2001 From: Mingwei Tian Date: Thu, 5 Sep 2024 11:39:46 -0700 Subject: [PATCH 1/2] [rocksdb] add metric for num level 0 files --- crates/typed-store/src/metrics.rs | 8 ++++++++ crates/typed-store/src/rocks/mod.rs | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/crates/typed-store/src/metrics.rs b/crates/typed-store/src/metrics.rs index 826f9a3f46e29..76e23386594b1 100644 --- a/crates/typed-store/src/metrics.rs +++ b/crates/typed-store/src/metrics.rs @@ -78,6 +78,7 @@ pub struct ColumnFamilyMetrics { pub rocksdb_total_sst_files_size: IntGaugeVec, pub rocksdb_total_blob_files_size: IntGaugeVec, pub rocksdb_total_num_files: IntGaugeVec, + pub rocksdb_num_level0_files: IntGaugeVec, pub rocksdb_current_size_active_mem_tables: IntGaugeVec, pub rocksdb_size_all_mem_tables: IntGaugeVec, pub rocksdb_num_snapshots: IntGaugeVec, @@ -124,6 +125,13 @@ impl ColumnFamilyMetrics { registry, ) .unwrap(), + rocksdb_num_level0_files: register_int_gauge_vec_with_registry!( + "rocksdb_num_level0_files", + "Number of level 0 files in the column family", + &["cf_name"], + registry, + ) + .unwrap(), rocksdb_current_size_active_mem_tables: register_int_gauge_vec_with_registry!( "rocksdb_current_size_active_mem_tables", "The current approximate size of active memtable (bytes).", diff --git a/crates/typed-store/src/rocks/mod.rs b/crates/typed-store/src/rocks/mod.rs index d794cbfc260ec..5f65067cc4525 100644 --- a/crates/typed-store/src/rocks/mod.rs +++ b/crates/typed-store/src/rocks/mod.rs @@ -1006,6 +1006,14 @@ impl DBMap { .rocksdb_total_num_files .with_label_values(&[cf_name]) .set(total_num_files); + db_metrics + .cf_metrics + .rocksdb_num_level0_files + .with_label_values(&[cf_name]) + .set( + Self::get_int_property(rocksdb, &cf, &num_files_at_level(0)) + .unwrap_or(METRICS_ERROR), + ); db_metrics .cf_metrics .rocksdb_current_size_active_mem_tables From a9906027e08884d1d72835e0de6e46e5281491d1 Mon Sep 17 00:00:00 2001 From: Mingwei Tian Date: Thu, 5 Sep 2024 11:46:25 -0700 Subject: [PATCH 2/2] Allow unmaintained proc-macro-error --- deny.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/deny.toml b/deny.toml index b1f837e63143e..c5b514a742b35 100644 --- a/deny.toml +++ b/deny.toml @@ -34,6 +34,8 @@ ignore = [ "RUSTSEC-2024-0336", # allow yaml-rust being unmaintained "RUSTSEC-2024-0320", + # allow unmaintained proc-macro-error used in transitive dependencies + "RUSTSEC-2024-0370", ] # Threshold for security vulnerabilities, any vulnerability with a CVSS score # lower than the range specified will be ignored. Note that ignored advisories