Skip to content

Commit 378d456

Browse files
committed
Address comment
1 parent 4f85bb7 commit 378d456

File tree

1 file changed

+4
-8
lines changed

1 file changed

+4
-8
lines changed

test/cpp/qps/driver.cc

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -575,9 +575,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
575575
// Start a run
576576
gpr_log(GPR_INFO, "Starting");
577577

578-
google::protobuf::Timestamp start_timestamp;
579-
start_timestamp.set_seconds(time(NULL));
580-
start_timestamp.set_nanos(0);
578+
auto start_time = time(NULL);
581579

582580
for (size_t i = 0; i < num_servers; i++) {
583581
auto server = &servers[i];
@@ -630,9 +628,7 @@ std::unique_ptr<ScenarioResult> RunScenario(
630628
bool client_finish_first =
631629
(client_config.rpc_type() != STREAMING_FROM_SERVER);
632630

633-
google::protobuf::Timestamp end_timestamp;
634-
end_timestamp.set_seconds(time(NULL));
635-
end_timestamp.set_nanos(0);
631+
auto end_time = time(NULL);
636632

637633
FinishClients(clients, client_mark);
638634

@@ -662,8 +658,8 @@ std::unique_ptr<ScenarioResult> RunScenario(
662658
}
663659

664660
// Fill in start and end time for the test scenario
665-
result->mutable_summary()->mutable_start_time()->CopyFrom(start_timestamp);
666-
result->mutable_summary()->mutable_end_time()->CopyFrom(end_timestamp);
661+
result->mutable_summary()->mutable_start_time()->set_seconds(start_time);
662+
result->mutable_summary()->mutable_end_time()->set_seconds(end_time);
667663

668664
postprocess_scenario_result(result.get());
669665
return result;

0 commit comments

Comments
 (0)