@ -25,6 +25,8 @@
# include <unordered_map>
# include <unordered_map>
# include <vector>
# include <vector>
# include "google/protobuf/timestamp.pb.h"
# include <grpc/support/alloc.h>
# include <grpc/support/alloc.h>
# include <grpc/support/log.h>
# include <grpc/support/log.h>
# include <grpc/support/string_util.h>
# include <grpc/support/string_util.h>
@ -573,6 +575,9 @@ std::unique_ptr<ScenarioResult> RunScenario(
// Start a run
// Start a run
gpr_log ( GPR_INFO , " Starting " ) ;
gpr_log ( GPR_INFO , " Starting " ) ;
auto start_time = time ( nullptr ) ;
for ( size_t i = 0 ; i < num_servers ; i + + ) {
for ( size_t i = 0 ; i < num_servers ; i + + ) {
auto server = & servers [ i ] ;
auto server = & servers [ i ] ;
if ( ! server - > stream - > Write ( server_mark ) ) {
if ( ! server - > stream - > Write ( server_mark ) ) {
@ -624,6 +629,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
bool client_finish_first =
bool client_finish_first =
( client_config . rpc_type ( ) ! = STREAMING_FROM_SERVER ) ;
( client_config . rpc_type ( ) ! = STREAMING_FROM_SERVER ) ;
auto end_time = time ( nullptr ) ;
FinishClients ( clients , client_mark ) ;
FinishClients ( clients , client_mark ) ;
if ( ! client_finish_first ) {
if ( ! client_finish_first ) {
@ -650,6 +657,11 @@ std::unique_ptr<ScenarioResult> RunScenario(
rrc - > set_status_code ( it - > first ) ;
rrc - > set_status_code ( it - > first ) ;
rrc - > set_count ( it - > second ) ;
rrc - > set_count ( it - > second ) ;
}
}
// Fill in start and end time for the test scenario
result - > mutable_summary ( ) - > mutable_start_time ( ) - > set_seconds ( start_time ) ;
result - > mutable_summary ( ) - > mutable_end_time ( ) - > set_seconds ( end_time ) ;
postprocess_scenario_result ( result . get ( ) ) ;
postprocess_scenario_result ( result . get ( ) ) ;
return result ;
return result ;
}
}