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
87f2aa24
Commit
87f2aa24
authored
Sep 21, 2016
by
zhangjinpeng1987
Committed by
Jay
Sep 21, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable statistics (#42)
parent
8e198679
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
25 additions
and
1 deletion
+25
-1
lib.rs
librocksdb_sys/src/lib.rs
+2
-0
main.rs
src/main.rs
+2
-0
rocksdb.rs
src/rocksdb.rs
+1
-1
rocksdb_options.rs
src/rocksdb_options.rs
+20
-0
No files found.
librocksdb_sys/src/lib.rs
View file @
87f2aa24
...
...
@@ -181,6 +181,8 @@ extern "C" {
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_enable_statistics
(
options
:
*
mut
DBOptions
);
pub
fn
rocksdb_options_set_stats_dump_period_sec
(
options
:
*
mut
DBOptions
,
v
:
usize
);
pub
fn
rocksdb_filterpolicy_create_bloom_full
(
bits_per_key
:
c_int
)
->
*
mut
DBFilterPolicy
;
pub
fn
rocksdb_filterpolicy_create_bloom
(
bits_per_key
:
c_int
)
...
...
src/main.rs
View file @
87f2aa24
...
...
@@ -181,6 +181,8 @@ mod tests {
opts
.set_filter_deletes
(
false
);
opts
.set_report_bg_io_stats
(
true
);
opts
.set_wal_recovery_mode
(
DBRecoveryMode
::
PointInTime
);
opts
.enable_statistics
();
opts
.set_stats_dump_period_sec
(
60
);
opts
.compression_per_level
(
&
per_level_compression
);
blockopts
.set_block_size
(
524288
);
blockopts
.set_cache_index_and_filter_blocks
(
true
);
...
...
src/rocksdb.rs
View file @
87f2aa24
...
...
@@ -555,7 +555,7 @@ impl DB {
opts
.inner
,
cname_ptr
,
&
mut
err
);
if
!
err
.is_null
()
{
return
Err
(
error_message
(
err
));
}
...
...
src/rocksdb_options.rs
View file @
87f2aa24
...
...
@@ -505,6 +505,19 @@ impl Options {
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
:
usize
)
{
unsafe
{
rocksdb_ffi
::
rocksdb_options_set_stats_dump_period_sec
(
self
.inner
,
period
);
}
}
}
#[cfg(test)]
...
...
@@ -517,4 +530,11 @@ mod tests {
let
size
=
20
*
1024
*
1024
;
opts
.set_max_manifest_file_size
(
size
)
}
#[test]
fn
test_enable_statistics
()
{
let
mut
opts
=
Options
::
new
();
opts
.enable_statistics
();
opts
.set_stats_dump_period_sec
(
60
);
}
}
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