diff options
author | Craig Tiller <ctiller@google.com> | 2015-10-08 13:31:02 -0700 |
---|---|---|
committer | Craig Tiller <ctiller@google.com> | 2015-10-08 13:31:02 -0700 |
commit | 86253ca1da5349488e7098fcb794a1bf26d88415 (patch) | |
tree | 56a009ed1e4889ff2c4a3c2906f56fded4430481 /src/cpp | |
parent | 9bb016125139bb7cdf5d0ff71b3fd25d13b75134 (diff) |
Latency traces
Diffstat (limited to 'src/cpp')
-rw-r--r-- | src/cpp/client/channel.cc | 3 | ||||
-rw-r--r-- | src/cpp/server/server.cc | 4 |
2 files changed, 4 insertions, 3 deletions
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<grpc::mutex> lock(mu_); |