@ -4523,7 +4523,7 @@ TEST_F(DBTest2, TraceAndReplay) {
ASSERT_OK ( replayer - > Prepare ( ) ) ;
ASSERT_OK ( replayer - > Prepare ( ) ) ;
// Replay using 1 thread, 1x speed.
// Replay using 1 thread, 1x speed.
ASSERT_OK ( replayer - > Replay ( ReplayOptions ( 1 , 1.0 ) , res_cb ) ) ;
ASSERT_OK ( replayer - > Replay ( ReplayOptions ( 1 , 1.0 ) , res_cb ) ) ;
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 8 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 8 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 2 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 2 ) ;
@ -4549,7 +4549,7 @@ TEST_F(DBTest2, TraceAndReplay) {
// Re-replay using 2 threads, 2x speed.
// Re-replay using 2 threads, 2x speed.
ASSERT_OK ( replayer - > Prepare ( ) ) ;
ASSERT_OK ( replayer - > Prepare ( ) ) ;
ASSERT_OK ( replayer - > Replay ( ReplayOptions ( 2 , 2.0 ) , res_cb ) ) ;
ASSERT_OK ( replayer - > Replay ( ReplayOptions ( 2 , 2.0 ) , res_cb ) ) ;
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 8 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 8 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 2 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 2 ) ;
@ -4559,7 +4559,7 @@ TEST_F(DBTest2, TraceAndReplay) {
// Re-replay using 2 threads, 1/2 speed.
// Re-replay using 2 threads, 1/2 speed.
ASSERT_OK ( replayer - > Prepare ( ) ) ;
ASSERT_OK ( replayer - > Prepare ( ) ) ;
ASSERT_OK ( replayer - > Replay ( ReplayOptions ( 2 , 0.5 ) , res_cb ) ) ;
ASSERT_OK ( replayer - > Replay ( ReplayOptions ( 2 , 0.5 ) , res_cb ) ) ;
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 8 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 8 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 2 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 2 ) ;
@ -4757,7 +4757,7 @@ TEST_F(DBTest2, TraceAndManualReplay) {
// end, or Prepare() was not called.
// end, or Prepare() was not called.
ASSERT_TRUE ( s . IsIncomplete ( ) ) ;
ASSERT_TRUE ( s . IsIncomplete ( ) ) ;
ASSERT_TRUE ( replayer - > Next ( nullptr ) . IsIncomplete ( ) ) ;
ASSERT_TRUE ( replayer - > Next ( nullptr ) . IsIncomplete ( ) ) ;
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 9 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 9 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 3 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 8 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 8 ) ;
@ -4791,7 +4791,7 @@ TEST_F(DBTest2, TraceAndManualReplay) {
ASSERT_EQ ( " write1 " , value ) ;
ASSERT_EQ ( " write1 " , value ) ;
ASSERT_OK ( db2 - > Get ( ro , handles [ 0 ] , " trace-record-write2 " , & value ) ) ;
ASSERT_OK ( db2 - > Get ( ro , handles [ 0 ] , " trace-record-write2 " , & value ) ) ;
ASSERT_EQ ( " write2 " , value ) ;
ASSERT_EQ ( " write2 " , value ) ;
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 1 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 1 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 0 ) ;
@ -4816,7 +4816,7 @@ TEST_F(DBTest2, TraceAndManualReplay) {
record . reset ( new GetQueryTraceRecord ( invalid_cf_id , " whatever " , fake_ts + + ) ) ;
record . reset ( new GetQueryTraceRecord ( invalid_cf_id , " whatever " , fake_ts + + ) ) ;
ASSERT_TRUE ( replayer - > Execute ( record , & result ) . IsCorruption ( ) ) ;
ASSERT_TRUE ( replayer - > Execute ( record , & result ) . IsCorruption ( ) ) ;
ASSERT_TRUE ( result = = nullptr ) ;
ASSERT_TRUE ( result = = nullptr ) ;
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 2 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 2 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 0 ) ;
@ -4845,7 +4845,7 @@ TEST_F(DBTest2, TraceAndManualReplay) {
ASSERT_TRUE ( replayer - > Execute ( record , & result ) . IsCorruption ( ) ) ;
ASSERT_TRUE ( replayer - > Execute ( record , & result ) . IsCorruption ( ) ) ;
ASSERT_TRUE ( result = = nullptr ) ;
ASSERT_TRUE ( result = = nullptr ) ;
}
}
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 4 ) ; // Seek x 2 in two iterations
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 4 ) ; // Seek x 2 in two iterations
@ -4900,7 +4900,7 @@ TEST_F(DBTest2, TraceAndManualReplay) {
std : : vector < std : : string > ( { " a " } ) , fake_ts + + ) ) ;
std : : vector < std : : string > ( { " a " } ) , fake_ts + + ) ) ;
ASSERT_TRUE ( replayer - > Execute ( record , & result ) . IsInvalidArgument ( ) ) ;
ASSERT_TRUE ( replayer - > Execute ( record , & result ) . IsInvalidArgument ( ) ) ;
ASSERT_TRUE ( result = = nullptr ) ;
ASSERT_TRUE ( result = = nullptr ) ;
ASSERT_GT ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_GE ( res_handler . GetAvgLatency ( ) , 0.0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumWrites ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumGets ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 0 ) ;
ASSERT_EQ ( res_handler . GetNumIterSeeks ( ) , 0 ) ;