Repository: kudu Updated Branches: refs/heads/master 2692ac4ad -> 978cf3912
rpcz: print timeout units (ms) when logging Also print in human-readable format, which is easier to read for large values, for both the duration and the timeout. Since the human-readable version leaves a space between the value and the unit, do the same. Change-Id: I043d25b83cb4d2470cf0d9d3945e8ace633d9a5a Reviewed-on: http://gerrit.cloudera.org:8080/10915 Tested-by: Kudu Jenkins Reviewed-by: Dan Burkert <danburk...@apache.org> Project: http://git-wip-us.apache.org/repos/asf/kudu/repo Commit: http://git-wip-us.apache.org/repos/asf/kudu/commit/978cf391 Tree: http://git-wip-us.apache.org/repos/asf/kudu/tree/978cf391 Diff: http://git-wip-us.apache.org/repos/asf/kudu/diff/978cf391 Branch: refs/heads/master Commit: 978cf39124e1d5b637618384afd985cd3a002526 Parents: 2692ac4 Author: Mike Percy <mpe...@apache.org> Authored: Fri Jul 6 13:10:07 2018 -0700 Committer: Mike Percy <mpe...@apache.org> Committed: Thu Jul 12 16:37:53 2018 +0000 ---------------------------------------------------------------------- src/kudu/rpc/rpcz_store.cc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/kudu/blob/978cf391/src/kudu/rpc/rpcz_store.cc ---------------------------------------------------------------------- diff --git a/src/kudu/rpc/rpcz_store.cc b/src/kudu/rpc/rpcz_store.cc index 2f0e9c8..f7c7b3b 100644 --- a/src/kudu/rpc/rpcz_store.cc +++ b/src/kudu/rpc/rpcz_store.cc @@ -32,6 +32,7 @@ #include "kudu/gutil/port.h" #include "kudu/gutil/ref_counted.h" +#include "kudu/gutil/strings/human_readable.h" #include "kudu/gutil/strings/stringpiece.h" #include "kudu/gutil/walltime.h" #include "kudu/rpc/inbound_call.h" @@ -248,8 +249,11 @@ void RpczStore::LogTrace(InboundCall* call) { if (duration_ms > log_threshold) { // TODO: consider pushing this onto another thread since it may be slow. // The traces may also be too large to fit in a log message. - LOG(WARNING) << call->ToString() << " took " << duration_ms << "ms (client timeout " - << call->header_.timeout_millis() << ")."; + int64_t timeout_ms = call->header_.timeout_millis(); + LOG(WARNING) << call->ToString() << " took " << duration_ms << " ms " + << "(" << HumanReadableElapsedTime::ToShortString(duration_ms * .001) << "). " + << "Client timeout " << timeout_ms << " ms " + << "(" << HumanReadableElapsedTime::ToShortString(timeout_ms * .001) << ")"; string s = call->trace()->DumpToString(); if (!s.empty()) { LOG(WARNING) << "Trace:\n" << s;