Modify build file

pull/18881/head
Na-Na Pang 6 years ago
parent 32e10e618a
commit 1ba5f5c701
  1. 5
      test/cpp/microbenchmarks/BUILD
  2. 6
      test/cpp/microbenchmarks/callback_streaming_ping_pong.h
  3. 8
      test/cpp/microbenchmarks/callback_test_service.h

@ -232,10 +232,7 @@ grpc_cc_library(
],
tags = ["no_windows"],
deps = [
"//:grpc++_unsecure",
"//src/proto/grpc/testing:echo_proto",
"//test/core/util:grpc_test_util_unsecure",
"//test/cpp/util:test_config",
":helpers",
"//test/cpp/util:test_util",
],
)

@ -54,10 +54,8 @@ static void BM_CallbackBidiStreaming(benchmark::State& state) {
std::mutex mu;
std::condition_variable cv;
bool done = false;
BidiClient* test =
new BidiClient(&state, stub_.get(), &request, &response,
&mu, &cv, &done);
test->StartNewRpc();
BidiClient test{&state, stub_.get(), &request, &response, &mu, &cv, &done};
test.StartNewRpc();
std::unique_lock<std::mutex> l(mu);
while (!done) {
cv.wait(l);

@ -60,10 +60,6 @@ class BidiClient
done_(done) {
msgs_size_ = state->range(0);
msgs_to_send_ = state->range(1);
cli_ctx_ = new ClientContext();
cli_ctx_->AddMetadata(kServerFinishAfterNReads,
grpc::to_string(msgs_to_send_));
cli_ctx_->AddMetadata(kServerMessageSize, grpc::to_string(msgs_size_));
}
void OnReadDone(bool ok) override {
@ -98,6 +94,10 @@ class BidiClient
}
void StartNewRpc() {
cli_ctx_ = new ClientContext();
cli_ctx_->AddMetadata(kServerFinishAfterNReads,
grpc::to_string(msgs_to_send_));
cli_ctx_->AddMetadata(kServerMessageSize, grpc::to_string(msgs_size_));
stub_->experimental_async()->BidiStream(cli_ctx_, this);
MaybeWrite();
StartCall();

Loading…
Cancel
Save