@ -459,6 +459,7 @@ DEFINE_bool(verify_checksum, false, "Verify checksum for every block read"
" from storage " ) ;
" from storage " ) ;
DEFINE_bool ( statistics , false , " Database statistics " ) ;
DEFINE_bool ( statistics , false , " Database statistics " ) ;
DEFINE_string ( statistics_string , " " , " Serialized statistics string " ) ;
static class std : : shared_ptr < rocksdb : : Statistics > dbstats ;
static class std : : shared_ptr < rocksdb : : Statistics > dbstats ;
DEFINE_int64 ( writes , - 1 , " Number of write operations to do. If negative, do "
DEFINE_int64 ( writes , - 1 , " Number of write operations to do. If negative, do "
@ -4878,6 +4879,24 @@ int db_bench_tool(int argc, char** argv) {
ParseCommandLineFlags ( & argc , & argv , true ) ;
ParseCommandLineFlags ( & argc , & argv , true ) ;
FLAGS_compaction_style_e = ( rocksdb : : CompactionStyle ) FLAGS_compaction_style ;
FLAGS_compaction_style_e = ( rocksdb : : CompactionStyle ) FLAGS_compaction_style ;
# ifndef ROCKSDB_LITE
if ( FLAGS_statistics & & ! FLAGS_statistics_string . empty ( ) ) {
fprintf ( stderr ,
" Cannot provide both --statistics and --statistics_string. \n " ) ;
exit ( 1 ) ;
}
if ( ! FLAGS_statistics_string . empty ( ) ) {
std : : unique_ptr < Statistics > custom_stats_guard ;
dbstats . reset ( NewCustomObject < Statistics > ( FLAGS_statistics_string ,
& custom_stats_guard ) ) ;
custom_stats_guard . release ( ) ;
if ( dbstats = = nullptr ) {
fprintf ( stderr , " No Statistics registered matching string: %s \n " ,
FLAGS_statistics_string . c_str ( ) ) ;
exit ( 1 ) ;
}
}
# endif // ROCKSDB_LITE
if ( FLAGS_statistics ) {
if ( FLAGS_statistics ) {
dbstats = rocksdb : : CreateDBStatistics ( ) ;
dbstats = rocksdb : : CreateDBStatistics ( ) ;
}
}