From a7830930483ab2aa2ea2c32f92c4da93fb4fb02d Mon Sep 17 00:00:00 2001 From: jinpeng zhang Date: Wed, 8 Jun 2016 17:01:32 +0800 Subject: [PATCH] add report_gb_io_stats option --- src/ffi.rs | 1 + src/rocksdb_options.rs | 10 ++++++++++ 2 files changed, 11 insertions(+) diff --git a/src/ffi.rs b/src/ffi.rs index 5045d2f..9b160ae 100644 --- a/src/ffi.rs +++ b/src/ffi.rs @@ -189,6 +189,7 @@ extern "C" { pub fn rocksdb_options_set_filter_deletes(options: DBOptions, v: bool); pub fn rocksdb_options_set_disable_auto_compactions(options: DBOptions, v: c_int); + pub fn rocksdb_options_set_report_bg_io_stats(options: DBOptions, v: c_int); pub fn rocksdb_filterpolicy_create_bloom(bits_per_key: c_int) -> DBFilterPolicy; pub fn rocksdb_open(options: DBOptions, diff --git a/src/rocksdb_options.rs b/src/rocksdb_options.rs index 20f8a9c..4e3dfb3 100644 --- a/src/rocksdb_options.rs +++ b/src/rocksdb_options.rs @@ -315,6 +315,16 @@ impl Options { rocksdb_ffi::rocksdb_options_set_block_based_table_factory(self.inner, factory.inner); } } + + pub fn set_report_bg_io_stats(&mut self, enable: bool) { + unsafe { + if enable { + rocksdb_ffi::rocksdb_options_set_report_bg_io_stats(self.inner, 1); + } else { + rocksdb_ffi::rocksdb_options_set_report_bg_io_stats(self.inner, 0); + } + } + } } impl Default for Options {