diff --git a/clang-tools-extra/clangd/index/remote/Client.cpp b/clang-tools-extra/clangd/index/remote/Client.cpp --- a/clang-tools-extra/clangd/index/remote/Client.cpp +++ b/clang-tools-extra/clangd/index/remote/Client.cpp @@ -42,10 +42,14 @@ SPAN_ATTACH(Tracer, "Request", RPCRequest.DebugString()); grpc::ClientContext Context; Context.AddMetadata("version", clang::getClangToolFullVersion("clangd")); - std::chrono::system_clock::time_point Deadline = - std::chrono::system_clock::now() + DeadlineWaitingTime; + const std::chrono::system_clock::time_point StartTime = + std::chrono::system_clock::now(); + const std::chrono::system_clock::time_point Deadline = + StartTime + DeadlineWaitingTime; Context.set_deadline(Deadline); auto Reader = (Stub.get()->*RPCCall)(&Context, RPCRequest); + vlog("Sending RPC Request {0}: {1}", RequestT::descriptor()->name(), + RPCRequest.DebugString()); ReplyT Reply; unsigned Successful = 0; unsigned FailedToParse = 0; @@ -65,6 +69,11 @@ Callback(*Response); ++Successful; } + const auto Millis = std::chrono::duration_cast( + std::chrono::system_clock::now() - StartTime) + .count(); + vlog("RPC Request {0} => OK: {1} results in {2}ms", + RequestT::descriptor()->name(), Successful, Millis); SPAN_ATTACH(Tracer, "Status", Reader->Finish().ok()); SPAN_ATTACH(Tracer, "Successful", Successful); SPAN_ATTACH(Tracer, "Failed to parse", FailedToParse);