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
c16d9cfb
Commit
c16d9cfb
authored
Sep 20, 2017
by
Huachao Huang
Committed by
GitHub
Sep 20, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add histogram max (#133)
parent
024a6069
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
12 additions
and
2 deletions
+12
-2
c.cc
librocksdb_sys/crocksdb/c.cc
+3
-1
c.h
librocksdb_sys/crocksdb/crocksdb/c.h
+2
-1
lib.rs
librocksdb_sys/src/lib.rs
+1
-0
rocksdb_options.rs
src/rocksdb_options.rs
+2
-0
test_rocksdb_options.rs
tests/test_rocksdb_options.rs
+4
-0
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
c16d9cfb
...
...
@@ -2386,7 +2386,8 @@ unsigned char crocksdb_options_statistics_get_histogram(
double
*
percentile95
,
double
*
percentile99
,
double
*
average
,
double
*
standard_deviation
)
{
double
*
standard_deviation
,
double
*
max
)
{
rocksdb
::
Statistics
*
statistics
=
opt
->
rep
.
statistics
.
get
();
if
(
statistics
)
{
crocksdb_histogramdata_t
data
;
...
...
@@ -2396,6 +2397,7 @@ unsigned char crocksdb_options_statistics_get_histogram(
*
percentile99
=
data
.
rep
.
percentile99
;
*
average
=
data
.
rep
.
average
;
*
standard_deviation
=
data
.
rep
.
standard_deviation
;
*
max
=
data
.
rep
.
max
;
return
1
;
}
return
0
;
...
...
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
c16d9cfb
...
...
@@ -801,7 +801,8 @@ extern C_ROCKSDB_LIBRARY_API unsigned char crocksdb_options_statistics_get_histo
double
*
percentile95
,
double
*
percentile99
,
double
*
average
,
double
*
standard_deviation
);
double
*
standard_deviation
,
double
*
max
);
extern
C_ROCKSDB_LIBRARY_API
void
crocksdb_options_set_max_write_buffer_number
(
crocksdb_options_t
*
,
int
);
...
...
librocksdb_sys/src/lib.rs
View file @
c16d9cfb
...
...
@@ -438,6 +438,7 @@ extern "C" {
percentile99
:
*
mut
c_double
,
average
:
*
mut
c_double
,
standard_deviation
:
*
mut
c_double
,
max
:
*
mut
c_double
,
)
->
bool
;
pub
fn
crocksdb_options_set_stats_dump_period_sec
(
options
:
*
mut
Options
,
v
:
usize
);
pub
fn
crocksdb_options_set_num_levels
(
options
:
*
mut
Options
,
v
:
c_int
);
...
...
src/rocksdb_options.rs
View file @
c16d9cfb
...
...
@@ -38,6 +38,7 @@ pub struct HistogramData {
pub
percentile99
:
f64
,
pub
average
:
f64
,
pub
standard_deviation
:
f64
,
pub
max
:
f64
,
}
pub
struct
BlockBasedOptions
{
...
...
@@ -570,6 +571,7 @@ impl DBOptions {
&
mut
data
.percentile99
,
&
mut
data
.average
,
&
mut
data
.standard_deviation
,
&
mut
data
.max
,
);
if
!
ret
{
return
None
;
...
...
tests/test_rocksdb_options.rs
View file @
c16d9cfb
...
...
@@ -73,6 +73,10 @@ fn test_enable_statistics() {
opts
.enable_statistics
();
opts
.set_stats_dump_period_sec
(
60
);
assert
!
(
opts
.get_statistics
()
.is_some
());
assert
!
(
opts
.get_statistics_histogram
(
HistogramType
::
SeekMicros
)
.is_some
()
);
assert
!
(
opts
.get_statistics_histogram_string
(
HistogramType
::
SeekMicros
)
.is_some
()
...
...
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