This is an automated email from the ASF dual-hosted git repository.

granthenke pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/kudu.git

commit de3b76466ff8dc8cd85ce2f218f54e71067d013b
Author: Tim Armstrong <[email protected]>
AuthorDate: Mon Feb 10 10:10:32 2020 -0800

    KUDU-2996: trace when rpc_duration_too_long_ms exceeded
    
    Change-Id: I20d9b5e318f4a987051f1f7c2cd5b1d92c61bd05
    Reviewed-on: http://gerrit.cloudera.org:8080/15197
    Tested-by: Alexey Serbin <[email protected]>
    Reviewed-by: Alexey Serbin <[email protected]>
---
 src/kudu/rpc/rpcz_store.cc | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/kudu/rpc/rpcz_store.cc b/src/kudu/rpc/rpcz_store.cc
index f7c7b3b..83c62c9 100644
--- a/src/kudu/rpc/rpcz_store.cc
+++ b/src/kudu/rpc/rpcz_store.cc
@@ -20,6 +20,7 @@
 #include <algorithm>  // IWYU pragma: keep
 #include <array>
 #include <cstdint>
+#include <map>
 #include <mutex> // for unique_lock
 #include <ostream>
 #include <string>
@@ -261,13 +262,12 @@ void RpczStore::LogTrace(InboundCall* call) {
       return;
     }
   }
-
-  if (PREDICT_FALSE(FLAGS_rpc_dump_all_traces)) {
+  if (duration_ms > FLAGS_rpc_duration_too_long_ms ||
+      PREDICT_FALSE(FLAGS_rpc_dump_all_traces)) {
+    const auto flags = (duration_ms > FLAGS_rpc_duration_too_long_ms)
+        ? Trace::INCLUDE_ALL : Trace::INCLUDE_TIME_DELTAS;
     LOG(INFO) << call->ToString() << " took " << duration_ms << "ms. Trace:";
-    call->trace()->Dump(&LOG(INFO), true);
-  } else if (duration_ms > FLAGS_rpc_duration_too_long_ms) {
-    LOG(INFO) << call->ToString() << " took " << duration_ms << "ms. "
-              << "Request Metrics: " << call->trace()->MetricsAsJSON();
+    call->trace()->Dump(&LOG(INFO), flags);
   }
 }
 

Reply via email to