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
4c07eb84
Commit
4c07eb84
authored
Mar 03, 2020
by
Wallace
Committed by
Yi Wu
Mar 20, 2020
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add write thread wait time for perf context (#439)
* add write thread wait time for perf context
parent
518aa2a2
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
35 additions
and
4 deletions
+35
-4
c.cc
librocksdb_sys/crocksdb/c.cc
+8
-0
c.h
librocksdb_sys/crocksdb/crocksdb/c.h
+4
-0
lib.rs
librocksdb_sys/src/lib.rs
+4
-0
perf_context.rs
src/perf_context.rs
+19
-4
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
4c07eb84
...
@@ -4969,6 +4969,14 @@ uint64_t crocksdb_perf_context_db_mutex_lock_nanos(crocksdb_perf_context_t* ctx)
...
@@ -4969,6 +4969,14 @@ uint64_t crocksdb_perf_context_db_mutex_lock_nanos(crocksdb_perf_context_t* ctx)
return
ctx
->
rep
.
db_mutex_lock_nanos
;
return
ctx
->
rep
.
db_mutex_lock_nanos
;
}
}
uint64_t
crocksdb_perf_context_write_thread_wait_nanos
(
crocksdb_perf_context_t
*
ctx
)
{
return
ctx
->
rep
.
write_thread_wait_nanos
;
}
uint64_t
crocksdb_perf_context_write_scheduling_flushes_compactions_time
(
crocksdb_perf_context_t
*
ctx
)
{
return
ctx
->
rep
.
write_scheduling_flushes_compactions_time
;
}
uint64_t
crocksdb_perf_context_db_condition_wait_nanos
(
crocksdb_perf_context_t
*
ctx
)
{
uint64_t
crocksdb_perf_context_db_condition_wait_nanos
(
crocksdb_perf_context_t
*
ctx
)
{
return
ctx
->
rep
.
db_condition_wait_nanos
;
return
ctx
->
rep
.
db_condition_wait_nanos
;
}
}
...
...
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
4c07eb84
...
@@ -1952,6 +1952,10 @@ crocksdb_perf_context_write_pre_and_post_process_time(crocksdb_perf_context_t*);
...
@@ -1952,6 +1952,10 @@ crocksdb_perf_context_write_pre_and_post_process_time(crocksdb_perf_context_t*);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_perf_context_db_mutex_lock_nanos
(
crocksdb_perf_context_t
*
);
crocksdb_perf_context_db_mutex_lock_nanos
(
crocksdb_perf_context_t
*
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_perf_context_write_thread_wait_nanos
(
crocksdb_perf_context_t
*
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_perf_context_write_scheduling_flushes_compactions_time
(
crocksdb_perf_context_t
*
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_perf_context_db_condition_wait_nanos
(
crocksdb_perf_context_t
*
);
crocksdb_perf_context_db_condition_wait_nanos
(
crocksdb_perf_context_t
*
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_perf_context_merge_operator_time_nanos
(
crocksdb_perf_context_t
*
);
crocksdb_perf_context_merge_operator_time_nanos
(
crocksdb_perf_context_t
*
);
...
...
librocksdb_sys/src/lib.rs
View file @
4c07eb84
...
@@ -1947,6 +1947,10 @@ extern "C" {
...
@@ -1947,6 +1947,10 @@ extern "C" {
pub
fn
crocksdb_perf_context_write_delay_time
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_write_delay_time
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_write_pre_and_post_process_time
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_write_pre_and_post_process_time
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_db_mutex_lock_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_db_mutex_lock_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_write_thread_wait_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_write_scheduling_flushes_compactions_time
(
ctx
:
*
mut
DBPerfContext
,
)
->
u64
;
pub
fn
crocksdb_perf_context_db_condition_wait_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_db_condition_wait_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_merge_operator_time_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_merge_operator_time_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_read_index_block_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
pub
fn
crocksdb_perf_context_read_index_block_nanos
(
ctx
:
*
mut
DBPerfContext
)
->
u64
;
...
...
src/perf_context.rs
View file @
4c07eb84
...
@@ -19,6 +19,7 @@ pub enum PerfLevel {
...
@@ -19,6 +19,7 @@ pub enum PerfLevel {
Disable
,
Disable
,
EnableCount
,
EnableCount
,
EnableTimeExceptForMutex
,
EnableTimeExceptForMutex
,
EnableTimeAndCPUTimeExceptForMutex
,
EnableTime
,
EnableTime
,
OutOfBounds
,
OutOfBounds
,
}
}
...
@@ -30,8 +31,9 @@ pub fn get_perf_level() -> PerfLevel {
...
@@ -30,8 +31,9 @@ pub fn get_perf_level() -> PerfLevel {
1
=>
PerfLevel
::
Disable
,
1
=>
PerfLevel
::
Disable
,
2
=>
PerfLevel
::
EnableCount
,
2
=>
PerfLevel
::
EnableCount
,
3
=>
PerfLevel
::
EnableTimeExceptForMutex
,
3
=>
PerfLevel
::
EnableTimeExceptForMutex
,
4
=>
PerfLevel
::
EnableTime
,
4
=>
PerfLevel
::
EnableTimeAndCPUTimeExceptForMutex
,
5
=>
PerfLevel
::
OutOfBounds
,
5
=>
PerfLevel
::
EnableTime
,
6
=>
PerfLevel
::
OutOfBounds
,
_
=>
unreachable!
(),
_
=>
unreachable!
(),
}
}
}
}
...
@@ -42,8 +44,9 @@ pub fn set_perf_level(level: PerfLevel) {
...
@@ -42,8 +44,9 @@ pub fn set_perf_level(level: PerfLevel) {
PerfLevel
::
Disable
=>
1
,
PerfLevel
::
Disable
=>
1
,
PerfLevel
::
EnableCount
=>
2
,
PerfLevel
::
EnableCount
=>
2
,
PerfLevel
::
EnableTimeExceptForMutex
=>
3
,
PerfLevel
::
EnableTimeExceptForMutex
=>
3
,
PerfLevel
::
EnableTime
=>
4
,
PerfLevel
::
EnableTimeAndCPUTimeExceptForMutex
=>
4
,
PerfLevel
::
OutOfBounds
=>
5
,
PerfLevel
::
EnableTime
=>
5
,
PerfLevel
::
OutOfBounds
=>
6
,
};
};
unsafe
{
unsafe
{
crocksdb_ffi
::
crocksdb_set_perf_level
(
v
);
crocksdb_ffi
::
crocksdb_set_perf_level
(
v
);
...
@@ -203,6 +206,18 @@ impl PerfContext {
...
@@ -203,6 +206,18 @@ impl PerfContext {
unsafe
{
crocksdb_ffi
::
crocksdb_perf_context_db_mutex_lock_nanos
(
self
.inner
)
}
unsafe
{
crocksdb_ffi
::
crocksdb_perf_context_db_mutex_lock_nanos
(
self
.inner
)
}
}
}
pub
fn
write_thread_wait_nanos
(
&
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_perf_context_write_thread_wait_nanos
(
self
.inner
)
}
}
pub
fn
write_scheduling_flushes_compactions_time
(
&
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_perf_context_write_scheduling_flushes_compactions_time
(
self
.inner
,
)
}
}
pub
fn
db_condition_wait_nanos
(
&
self
)
->
u64
{
pub
fn
db_condition_wait_nanos
(
&
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_perf_context_db_condition_wait_nanos
(
self
.inner
)
}
unsafe
{
crocksdb_ffi
::
crocksdb_perf_context_db_condition_wait_nanos
(
self
.inner
)
}
}
}
...
...
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