aboutsummaryrefslogtreecommitdiffhomepage
path: root/test/cpp/microbenchmarks/bm_call_create.cc
diff options
context:
space:
mode:
authorGravatar Yuxuan Li <yuxuanli@google.com>2017-04-13 16:17:37 -0700
committerGravatar Yuxuan Li <yuxuanli@google.com>2017-04-13 16:17:37 -0700
commit784018d8a4ff251a74305406c402d9fa3bb6295b (patch)
tree1e3ff5b285bec2ce1a384cc7343b380a99f06380 /test/cpp/microbenchmarks/bm_call_create.cc
parentc7609c4f3f5471f87f3aaf66f4328accf29dd33e (diff)
use grpc_channel_create_registered_call
Diffstat (limited to 'test/cpp/microbenchmarks/bm_call_create.cc')
-rw-r--r--test/cpp/microbenchmarks/bm_call_create.cc9
1 files changed, 4 insertions, 5 deletions
diff --git a/test/cpp/microbenchmarks/bm_call_create.cc b/test/cpp/microbenchmarks/bm_call_create.cc
index 2fe4e0f53b..ada732c233 100644
--- a/test/cpp/microbenchmarks/bm_call_create.cc
+++ b/test/cpp/microbenchmarks/bm_call_create.cc
@@ -181,17 +181,16 @@ static void BM_LameChannelCallCreateCore(benchmark::State &state) {
grpc::testing::EchoRequest send_request;
grpc_slice send_request_slice =
grpc_slice_new(&send_request, sizeof(send_request), do_nothing);
- grpc_slice host = grpc_slice_from_static_string("localhost");
channel = grpc_lame_client_channel_create(
"localhost:1234", GRPC_STATUS_UNAUTHENTICATED, "blah");
cq = grpc_completion_queue_create(NULL);
-
+ void *rc = grpc_channel_register_call(
+ channel, "/grpc.testing.EchoTestService/Echo", NULL, NULL);
while (state.KeepRunning()) {
GPR_TIMER_SCOPE("BenchmarkCycle", 0);
- grpc_call *call = grpc_channel_create_call(
- channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq,
- grpc_slice_from_static_string("/EchoTestService/AsyncEcho"), &host,
+ grpc_call *call = grpc_channel_create_registered_call(
+ channel, NULL, GRPC_PROPAGATE_DEFAULTS, cq, rc,
gpr_inf_future(GPR_CLOCK_REALTIME), NULL);
grpc_metadata_array_init(&initial_metadata_recv);
grpc_metadata_array_init(&trailing_metadata_recv);