Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
R
rust-rocksdb
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
fangzongwu
rust-rocksdb
Commits
c7d2448d
Commit
c7d2448d
authored
Sep 21, 2016
by
zhangjinpeng1987
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable statistics
parent
8896042b
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
19 additions
and
2 deletions
+19
-2
lib.rs
librocksdb_sys/src/lib.rs
+3
-1
main.rs
src/main.rs
+2
-0
rocksdb_options.rs
src/rocksdb_options.rs
+14
-1
No files found.
librocksdb_sys/src/lib.rs
View file @
c7d2448d
...
@@ -17,7 +17,7 @@ extern crate libc;
...
@@ -17,7 +17,7 @@ extern crate libc;
#[cfg(test)]
#[cfg(test)]
extern
crate
tempdir
;
extern
crate
tempdir
;
use
libc
::{
c_char
,
c_uchar
,
c_int
,
c_void
,
size_t
,
uint64_t
};
use
libc
::{
c_char
,
c_uchar
,
c_int
,
c_
uint
,
c_
void
,
size_t
,
uint64_t
};
use
std
::
ffi
::
CStr
;
use
std
::
ffi
::
CStr
;
pub
enum
DBOptions
{}
pub
enum
DBOptions
{}
...
@@ -181,6 +181,8 @@ extern "C" {
...
@@ -181,6 +181,8 @@ extern "C" {
v
:
c_int
);
v
:
c_int
);
pub
fn
rocksdb_options_set_report_bg_io_stats
(
options
:
*
mut
DBOptions
,
v
:
c_int
);
pub
fn
rocksdb_options_set_report_bg_io_stats
(
options
:
*
mut
DBOptions
,
v
:
c_int
);
pub
fn
rocksdb_options_set_wal_recovery_mode
(
options
:
*
mut
DBOptions
,
mode
:
DBRecoveryMode
);
pub
fn
rocksdb_options_set_wal_recovery_mode
(
options
:
*
mut
DBOptions
,
mode
:
DBRecoveryMode
);
pub
fn
rocksdb_options_enable_statistics
(
options
:
*
mut
DBOptions
);
pub
fn
rocksdb_options_set_stats_dump_period_sec
(
options
:
*
mut
DBOptions
,
v
:
c_uint
);
pub
fn
rocksdb_filterpolicy_create_bloom_full
(
bits_per_key
:
c_int
)
pub
fn
rocksdb_filterpolicy_create_bloom_full
(
bits_per_key
:
c_int
)
->
*
mut
DBFilterPolicy
;
->
*
mut
DBFilterPolicy
;
pub
fn
rocksdb_filterpolicy_create_bloom
(
bits_per_key
:
c_int
)
pub
fn
rocksdb_filterpolicy_create_bloom
(
bits_per_key
:
c_int
)
...
...
src/main.rs
View file @
c7d2448d
...
@@ -181,6 +181,8 @@ mod tests {
...
@@ -181,6 +181,8 @@ mod tests {
opts
.set_filter_deletes
(
false
);
opts
.set_filter_deletes
(
false
);
opts
.set_report_bg_io_stats
(
true
);
opts
.set_report_bg_io_stats
(
true
);
opts
.set_wal_recovery_mode
(
DBRecoveryMode
::
PointInTime
);
opts
.set_wal_recovery_mode
(
DBRecoveryMode
::
PointInTime
);
opts
.enable_statistics
();
opts
.set_stats_dump_period_sec
(
60
);
opts
.compression_per_level
(
&
per_level_compression
);
opts
.compression_per_level
(
&
per_level_compression
);
blockopts
.set_block_size
(
524288
);
blockopts
.set_block_size
(
524288
);
blockopts
.set_cache_index_and_filter_blocks
(
true
);
blockopts
.set_cache_index_and_filter_blocks
(
true
);
...
...
src/rocksdb_options.rs
View file @
c7d2448d
...
@@ -14,7 +14,7 @@
...
@@ -14,7 +14,7 @@
//
//
use
comparator
::{
self
,
ComparatorCallback
,
compare_callback
};
use
comparator
::{
self
,
ComparatorCallback
,
compare_callback
};
use
libc
::{
c_int
,
size_t
};
use
libc
::{
c_int
,
c_uint
,
size_t
};
use
merge_operator
::{
self
,
MergeOperatorCallback
,
full_merge_callback
,
use
merge_operator
::{
self
,
MergeOperatorCallback
,
full_merge_callback
,
partial_merge_callback
};
partial_merge_callback
};
use
merge_operator
::
MergeFn
;
use
merge_operator
::
MergeFn
;
...
@@ -505,6 +505,19 @@ impl Options {
...
@@ -505,6 +505,19 @@ impl Options {
mode
);
mode
);
}
}
}
}
pub
fn
enable_statistics
(
&
mut
self
)
{
unsafe
{
rocksdb_ffi
::
rocksdb_options_enable_statistics
(
self
.inner
);
}
}
pub
fn
set_stats_dump_period_sec
(
&
mut
self
,
period
:
c_uint
)
{
unsafe
{
rocksdb_ffi
::
rocksdb_options_set_stats_dump_period_sec
(
self
.inner
,
period
);
}
}
}
}
#[cfg(test)]
#[cfg(test)]
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment