Merge pull request #20853 from grpc/revert-20809-fix-qps-json-driver-result-error

Revert "Measure benchmark results more accurately in qps_driver"
pull/20859/head
nanahpang 5 years ago committed by GitHub
commit f8bf05bcee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 30
      test/cpp/qps/driver.cc

@ -477,8 +477,17 @@ std::unique_ptr<ScenarioResult> RunScenario(
gpr_log(GPR_ERROR, "Failed WritesDone for client %zu", i);
}
}
gpr_log(GPR_INFO, "Finishing servers");
for (size_t i = 0; i < num_servers; i++) {
auto server = &servers[i];
if (!server->stream->Write(server_mark)) {
gpr_log(GPR_ERROR, "Couldn't write mark to server %zu", i);
}
if (!server->stream->WritesDone()) {
gpr_log(GPR_ERROR, "Failed WritesDone for server %zu", i);
}
}
// Collect clients' final run results right after finishing clients
for (size_t i = 0; i < num_clients; i++) {
auto client = &clients[i];
// Read the client final status
@ -492,24 +501,11 @@ std::unique_ptr<ScenarioResult> RunScenario(
}
result->add_client_stats()->CopyFrom(stats);
// That final status should be the last message on the client stream
// GPR_ASSERT(!client->stream->Read(&client_status));
GPR_ASSERT(!client->stream->Read(&client_status));
} else {
gpr_log(GPR_ERROR, "Couldn't get final status from client %zu", i);
}
}
gpr_log(GPR_INFO, "Finishing servers");
for (size_t i = 0; i < num_servers; i++) {
auto server = &servers[i];
if (!server->stream->Write(server_mark)) {
gpr_log(GPR_ERROR, "Couldn't write mark to server %zu", i);
}
if (!server->stream->WritesDone()) {
gpr_log(GPR_ERROR, "Failed WritesDone for server %zu", i);
}
}
// Get final rpc status from clients
for (size_t i = 0; i < num_clients; i++) {
auto client = &clients[i];
Status s = client->stream->Finish();
@ -524,7 +520,6 @@ std::unique_ptr<ScenarioResult> RunScenario(
}
}
// Post-processing the results summary
merged_latencies.FillProto(result->mutable_latencies());
for (std::unordered_map<int, int64_t>::iterator it = merged_statuses.begin();
it != merged_statuses.end(); ++it) {
@ -533,7 +528,6 @@ std::unique_ptr<ScenarioResult> RunScenario(
rrc->set_count(it->second);
}
// Collect servers' final run results right after finishing server
for (size_t i = 0; i < num_servers; i++) {
auto server = &servers[i];
// Read the server final status
@ -547,8 +541,6 @@ std::unique_ptr<ScenarioResult> RunScenario(
gpr_log(GPR_ERROR, "Couldn't get final status from server %zu", i);
}
}
// Get final rpc status from servers
for (size_t i = 0; i < num_servers; i++) {
auto server = &servers[i];
Status s = server->stream->Finish();

Loading…
Cancel
Save