From 86253ca1da5349488e7098fcb794a1bf26d88415 Mon Sep 17 00:00:00 2001 From: Craig Tiller Date: Thu, 8 Oct 2015 13:31:02 -0700 Subject: Latency traces --- src/cpp/client/channel.cc | 3 --- src/cpp/server/server.cc | 4 ++++ 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/cpp') diff --git a/src/cpp/client/channel.cc b/src/cpp/client/channel.cc index dc8e304664..c7974d655b 100644 --- a/src/cpp/client/channel.cc +++ b/src/cpp/client/channel.cc @@ -78,7 +78,6 @@ Call Channel::CreateCall(const RpcMethod& method, ClientContext* context, context->raw_deadline(), nullptr); } grpc_census_call_set_context(c_call, context->census_context()); - GRPC_TIMER_MARK(GRPC_PTAG_CPP_CALL_CREATED, c_call); context->set_call(c_call, shared_from_this()); return Call(c_call, this, cq); } @@ -87,11 +86,9 @@ void Channel::PerformOpsOnCall(CallOpSetInterface* ops, Call* call) { static const size_t MAX_OPS = 8; size_t nops = 0; grpc_op cops[MAX_OPS]; - GRPC_TIMER_BEGIN(GRPC_PTAG_CPP_PERFORM_OPS, call->call()); ops->FillOps(cops, &nops); GPR_ASSERT(GRPC_CALL_OK == grpc_call_start_batch(call->call(), cops, nops, ops, nullptr)); - GRPC_TIMER_END(GRPC_PTAG_CPP_PERFORM_OPS, call->call()); } void* Channel::RegisterMethod(const char* method) { diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc index a44e1d2025..f271973506 100644 --- a/src/cpp/server/server.cc +++ b/src/cpp/server/server.cc @@ -541,6 +541,7 @@ void Server::ScheduleCallback() { void Server::RunRpc() { // Wait for one more incoming rpc. bool ok; + GRPC_TIMER_BEGIN(GRPC_PTAG_SERVER_CALL, 0); auto* mrd = SyncRequest::Wait(&cq_, &ok); if (mrd) { ScheduleCallback(); @@ -556,9 +557,12 @@ void Server::RunRpc() { mrd->TeardownRequest(); } } + GRPC_TIMER_BEGIN(GRPC_PTAG_SERVER_CALLBACK, 0); cd.Run(); + GRPC_TIMER_END(GRPC_PTAG_SERVER_CALLBACK, 0); } } + GRPC_TIMER_END(GRPC_PTAG_SERVER_CALL, 0); { grpc::unique_lock lock(mu_); -- cgit v1.2.3