@ -95,13 +95,13 @@ void TableReaderBenchmark(Options& opts, EnvOptions& env_options,
}
}
std : : string start_key = MakeKey ( r1 , r2 ) ;
std : : string start_key = MakeKey ( r1 , r2 ) ;
std : : string end_key = MakeKey ( r1 , r2 + r2_len ) ;
std : : string end_key = MakeKey ( r1 , r2 + r2_len ) ;
uint64_t first_part _time = 0 ;
uint64_t total _time = 0 ;
uint64_t start_micros = env - > NowMicros ( ) ;
uint64_t start_micros = env - > NowMicros ( ) ;
Iterator * iter = table_reader - > NewIterator ( read_options ) ;
Iterator * iter = table_reader - > NewIterator ( read_options ) ;
int count = 0 ;
int count = 0 ;
for ( iter - > Seek ( start_key ) ; iter - > Valid ( ) ; iter - > Next ( ) ) {
for ( iter - > Seek ( start_key ) ; iter - > Valid ( ) ; iter - > Next ( ) ) {
// verify key;
// verify key;
first_part_time = env - > NowMicros ( ) - start_micros ;
total_time + = env - > NowMicros ( ) - start_micros ;
assert ( Slice ( MakeKey ( r1 , r2 + count ) ) = = iter - > key ( ) ) ;
assert ( Slice ( MakeKey ( r1 , r2 + count ) ) = = iter - > key ( ) ) ;
start_micros = env - > NowMicros ( ) ;
start_micros = env - > NowMicros ( ) ;
if ( + + count > = r2_len ) {
if ( + + count > = r2_len ) {
@ -115,7 +115,8 @@ void TableReaderBenchmark(Options& opts, EnvOptions& env_options,
assert ( false ) ;
assert ( false ) ;
}
}
delete iter ;
delete iter ;
hist . Add ( first_part_time + env - > NowMicros ( ) - start_micros ) ;
total_time + = env - > NowMicros ( ) - start_micros ;
hist . Add ( total_time ) ;
}
}
}
}
}
}
@ -129,7 +130,7 @@ void TableReaderBenchmark(Options& opts, EnvOptions& env_options,
" num_key2: %5d %10s \n "
" num_key2: %5d %10s \n "
" =================================================== "
" =================================================== "
" ==================================================== "
" ==================================================== "
" \n Histogram (unit: nan oseconds): \n %s " ,
" \n Histogram (unit: micr oseconds): \n %s " ,
tf - > Name ( ) , num_keys1 , num_keys2 ,
tf - > Name ( ) , num_keys1 , num_keys2 ,
for_iterator ? " iterator " : ( if_query_empty_keys ? " empty " : " non_empty " ) ,
for_iterator ? " iterator " : ( if_query_empty_keys ? " empty " : " non_empty " ) ,
hist . ToString ( ) . c_str ( ) ) ;
hist . ToString ( ) . c_str ( ) ) ;