Commit 260a80d3 authored by jinpeng zhang's avatar jinpeng zhang

add report_gb_io_stats option

parent 6ce85985
......@@ -193,6 +193,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,
......
......@@ -168,6 +168,7 @@ mod tests {
opts.set_max_background_compactions(4);
opts.set_max_background_flushes(4);
opts.set_filter_deletes(false);
opts.set_report_bg_io_stats(true);
blockopts.set_block_size(524288);
opts.set_block_based_table_factory(blockopts);
opts.set_disable_auto_compactions(true);
......
......@@ -359,6 +359,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 WriteOptions {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment