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
5d330edb
Unverified
Commit
5d330edb
authored
Aug 01, 2020
by
Xinye Tao
Committed by
GitHub
Aug 01, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add refill_period for creating rate limiter (#526)
Signed-off-by:
tabokie
<
xy.tao@outlook.com
>
parent
5e8633cb
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
2 deletions
+8
-2
rocksdb_options.rs
src/rocksdb_options.rs
+2
-1
test_rocksdb_options.rs
tests/cases/test_rocksdb_options.rs
+6
-1
No files found.
src/rocksdb_options.rs
View file @
5d330edb
...
...
@@ -991,12 +991,13 @@ impl DBOptions {
pub
fn
set_ratelimiter_with_auto_tuned
(
&
mut
self
,
rate_bytes_per_sec
:
i64
,
refill_period_us
:
i64
,
mode
:
DBRateLimiterMode
,
auto_tuned
:
bool
,
)
{
let
rate_limiter
=
RateLimiter
::
new_with_auto_tuned
(
rate_bytes_per_sec
,
DEFAULT_REFILL_PERIOD_US
,
refill_period_us
,
DEFAULT_FAIRNESS
,
mode
,
auto_tuned
,
...
...
tests/cases/test_rocksdb_options.rs
View file @
5d330edb
...
...
@@ -171,7 +171,12 @@ fn test_set_ratelimiter_with_auto_tuned() {
let
path
=
tempdir_with_prefix
(
"_rust_rocksdb_test_set_rate_limiter_with_auto_tuned"
);
let
mut
opts
=
DBOptions
::
new
();
opts
.create_if_missing
(
true
);
opts
.set_ratelimiter_with_auto_tuned
(
100
*
1024
*
1024
,
DBRateLimiterMode
::
AllIo
,
true
);
opts
.set_ratelimiter_with_auto_tuned
(
100
*
1024
*
1024
,
10
*
100000
,
DBRateLimiterMode
::
AllIo
,
true
);
let
db
=
DB
::
open
(
opts
,
path
.path
()
.to_str
()
.unwrap
())
.unwrap
();
drop
(
db
);
}
...
...
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