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
4fd63913
Commit
4fd63913
authored
Aug 17, 2017
by
Huachao Huang
Committed by
GitHub
Aug 17, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add some compaction job info stats. (#120)
parent
b95e696f
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
0 deletions
+29
-0
c.cc
librocksdb_sys/crocksdb/c.cc
+10
-0
c.h
librocksdb_sys/crocksdb/crocksdb/c.h
+4
-0
lib.rs
librocksdb_sys/src/lib.rs
+4
-0
event_listener.rs
src/event_listener.rs
+8
-0
test_event_listener.rs
tests/test_event_listener.rs
+3
-0
No files found.
librocksdb_sys/crocksdb/c.cc
View file @
4fd63913
...
@@ -1643,6 +1643,16 @@ crocksdb_compactionjobinfo_table_properties(
...
@@ -1643,6 +1643,16 @@ crocksdb_compactionjobinfo_table_properties(
&
info
->
rep
.
table_properties
);
&
info
->
rep
.
table_properties
);
}
}
uint64_t
crocksdb_compactionjobinfo_elapsed_micros
(
const
crocksdb_compactionjobinfo_t
*
info
)
{
return
info
->
rep
.
stats
.
elapsed_micros
;
}
uint64_t
crocksdb_compactionjobinfo_num_corrupt_keys
(
const
crocksdb_compactionjobinfo_t
*
info
)
{
return
info
->
rep
.
stats
.
num_corrupt_keys
;
}
/* ExternalFileIngestionInfo */
/* ExternalFileIngestionInfo */
const
char
*
crocksdb_externalfileingestioninfo_cf_name
(
const
char
*
crocksdb_externalfileingestioninfo_cf_name
(
...
...
librocksdb_sys/crocksdb/crocksdb/c.h
View file @
4fd63913
...
@@ -625,6 +625,10 @@ crocksdb_compactionjobinfo_output_file_at(const crocksdb_compactionjobinfo_t*,
...
@@ -625,6 +625,10 @@ crocksdb_compactionjobinfo_output_file_at(const crocksdb_compactionjobinfo_t*,
extern
C_ROCKSDB_LIBRARY_API
const
crocksdb_table_properties_collection_t
*
extern
C_ROCKSDB_LIBRARY_API
const
crocksdb_table_properties_collection_t
*
crocksdb_compactionjobinfo_table_properties
(
crocksdb_compactionjobinfo_table_properties
(
const
crocksdb_compactionjobinfo_t
*
);
const
crocksdb_compactionjobinfo_t
*
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_compactionjobinfo_elapsed_micros
(
const
crocksdb_compactionjobinfo_t
*
);
extern
C_ROCKSDB_LIBRARY_API
uint64_t
crocksdb_compactionjobinfo_num_corrupt_keys
(
const
crocksdb_compactionjobinfo_t
*
);
/* External file ingestion info */
/* External file ingestion info */
...
...
librocksdb_sys/src/lib.rs
View file @
4fd63913
...
@@ -1064,6 +1064,10 @@ extern "C" {
...
@@ -1064,6 +1064,10 @@ extern "C" {
->
*
const
c_char
;
->
*
const
c_char
;
pub
fn
crocksdb_compactionjobinfo_table_properties
(
info
:
*
const
DBCompactionJobInfo
)
pub
fn
crocksdb_compactionjobinfo_table_properties
(
info
:
*
const
DBCompactionJobInfo
)
->
*
const
DBTablePropertiesCollection
;
->
*
const
DBTablePropertiesCollection
;
pub
fn
crocksdb_compactionjobinfo_elapsed_micros
(
info
:
*
const
DBCompactionJobInfo
)
->
uint64_t
;
pub
fn
crocksdb_compactionjobinfo_num_corrupt_keys
(
info
:
*
const
DBCompactionJobInfo
)
->
uint64_t
;
pub
fn
crocksdb_externalfileingestioninfo_cf_name
(
info
:
*
const
DBIngestionInfo
,
pub
fn
crocksdb_externalfileingestioninfo_cf_name
(
info
:
*
const
DBIngestionInfo
,
size
:
*
mut
size_t
)
size
:
*
mut
size_t
)
...
...
src/event_listener.rs
View file @
4fd63913
...
@@ -80,6 +80,14 @@ impl CompactionJobInfo {
...
@@ -80,6 +80,14 @@ impl CompactionJobInfo {
TablePropertiesCollectionView
::
from_ptr
(
prop
)
TablePropertiesCollectionView
::
from_ptr
(
prop
)
}
}
}
}
pub
fn
elapsed_micros
(
&
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_compactionjobinfo_elapsed_micros
(
&
self
.
0
)
}
}
pub
fn
num_corrupt_keys
(
&
self
)
->
u64
{
unsafe
{
crocksdb_ffi
::
crocksdb_compactionjobinfo_num_corrupt_keys
(
&
self
.
0
)
}
}
}
}
pub
struct
IngestionInfo
(
DBIngestionInfo
);
pub
struct
IngestionInfo
(
DBIngestionInfo
);
...
...
tests/test_event_listener.rs
View file @
4fd63913
...
@@ -61,6 +61,9 @@ impl EventListener for EventCounter {
...
@@ -61,6 +61,9 @@ impl EventListener for EventCounter {
let
props
=
info
.table_properties
();
let
props
=
info
.table_properties
();
assert_eq!
(
props
.len
(),
output_file_count
+
input_file_count
);
assert_eq!
(
props
.len
(),
output_file_count
+
input_file_count
);
assert_ne!
(
info
.elapsed_micros
(),
0
);
assert_eq!
(
info
.num_corrupt_keys
(),
0
);
self
.compaction
.fetch_add
(
1
,
Ordering
::
SeqCst
);
self
.compaction
.fetch_add
(
1
,
Ordering
::
SeqCst
);
}
}
...
...
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