aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/cpp
diff options
context:
space:
mode:
authorGravatar Craig Tiller <ctiller@google.com>2015-10-09 15:07:02 -0700
committerGravatar Craig Tiller <ctiller@google.com>2015-10-09 15:07:02 -0700
commit1f41b6b5eda983052b31f60dcbe24b8021bc2fc2 (patch)
treed652190ccf684618da09d685da3d1019e196837b /src/cpp
parent8910ac6a363173b037a209debdc2b4528e9309f6 (diff)
Simplify adding annotations, annotate more things
Diffstat (limited to 'src/cpp')
-rw-r--r--src/cpp/proto/proto_utils.cc4
-rw-r--r--src/cpp/server/server.cc6
2 files changed, 6 insertions, 4 deletions
diff --git a/src/cpp/proto/proto_utils.cc b/src/cpp/proto/proto_utils.cc
index 4131fbe5e5..a7b6fd241b 100644
--- a/src/cpp/proto/proto_utils.cc
+++ b/src/cpp/proto/proto_utils.cc
@@ -42,6 +42,8 @@
#include <grpc/support/port_platform.h>
#include <grpc++/support/config.h>
+#include "src/core/profiling/timers.h"
+
const int kMaxBufferLength = 8192;
class GrpcBufferWriter GRPC_FINAL
@@ -158,6 +160,7 @@ namespace grpc {
Status SerializeProto(const grpc::protobuf::Message& msg,
grpc_byte_buffer** bp) {
+ GRPC_TIMER_SCOPE("SerializeProto", 0);
int byte_size = msg.ByteSize();
if (byte_size <= kMaxBufferLength) {
gpr_slice slice = gpr_slice_malloc(byte_size);
@@ -176,6 +179,7 @@ Status SerializeProto(const grpc::protobuf::Message& msg,
Status DeserializeProto(grpc_byte_buffer* buffer, grpc::protobuf::Message* msg,
int max_message_size) {
+ GRPC_TIMER_SCOPE("DeserializeProto", 0);
if (!buffer) {
return Status(StatusCode::INTERNAL, "No payload");
}
diff --git a/src/cpp/server/server.cc b/src/cpp/server/server.cc
index f271973506..2cd1905a97 100644
--- a/src/cpp/server/server.cc
+++ b/src/cpp/server/server.cc
@@ -541,7 +541,7 @@ void Server::ScheduleCallback() {
void Server::RunRpc() {
// Wait for one more incoming rpc.
bool ok;
- GRPC_TIMER_BEGIN(GRPC_PTAG_SERVER_CALL, 0);
+ GRPC_TIMER_SCOPE("Server::RunRpc", 0);
auto* mrd = SyncRequest::Wait(&cq_, &ok);
if (mrd) {
ScheduleCallback();
@@ -557,12 +557,10 @@ void Server::RunRpc() {
mrd->TeardownRequest();
}
}
- GRPC_TIMER_BEGIN(GRPC_PTAG_SERVER_CALLBACK, 0);
+ GRPC_TIMER_SCOPE("cd.Run()", 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_);