From a977adff919af17028599855ddbf5f6513b7b28f Mon Sep 17 00:00:00 2001 From: Tpt Date: Sat, 1 Apr 2023 15:10:42 +0200 Subject: [PATCH] Allows to collect RocksDB statistics Hidden behind the "rocksdb_debug" features --- lib/Cargo.toml | 1 + lib/src/storage/backend/rocksdb.rs | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/lib/Cargo.toml b/lib/Cargo.toml index 2f9b8d95..248da826 100644 --- a/lib/Cargo.toml +++ b/lib/Cargo.toml @@ -20,6 +20,7 @@ all-features = true [features] default = [] http_client = ["oxhttp", "oxhttp/rustls"] +rocksdb_debug = [] [dependencies] rand = "0.8" diff --git a/lib/src/storage/backend/rocksdb.rs b/lib/src/storage/backend/rocksdb.rs index 1ddfc519..6da4be07 100644 --- a/lib/src/storage/backend/rocksdb.rs +++ b/lib/src/storage/backend/rocksdb.rs @@ -212,6 +212,12 @@ impl Db { 16, ); rocksdb_options_set_block_based_table_factory(options, block_based_table_options); + #[cfg(feature = "rocksdb_debug")] + { + rocksdb_options_set_info_log_level(options, 0); + rocksdb_options_enable_statistics(options); + rocksdb_options_set_stats_dump_period_sec(options, 60); + } let (column_family_names, c_column_family_names, cf_options) = Self::column_families_names_and_options(column_families, options);