diff options
author | Haley Connelly <haley.connelly@10gen.com> | 2018-07-31 18:27:03 -0400 |
---|---|---|
committer | Haley Connelly <haley.connelly@10gen.com> | 2018-07-31 18:34:33 -0400 |
commit | 075d7fe467e12aa3dfa19aff27672a7a5b34aff0 (patch) | |
tree | fe54aa2b9079fd063b08a1fca09f195f12354ef8 /src/mongo/db/curop.cpp | |
parent | 6711ab3bbc02ca98da1af2fe115f07e37bb076e4 (diff) | |
download | mongo-075d7fe467e12aa3dfa19aff27672a7a5b34aff0.tar.gz |
SERVER-23332 Expose query plan cache key in system.profile entry and query log lines
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r-- | src/mongo/db/curop.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp index edd98dc2b99..e5b9186709d 100644 --- a/src/mongo/db/curop.cpp +++ b/src/mongo/db/curop.cpp @@ -34,6 +34,8 @@ #include "mongo/db/curop.h" +#include <iomanip> + #include "mongo/base/disallow_copying.h" #include "mongo/bson/mutable/document.h" #include "mongo/db/client.h" @@ -45,6 +47,7 @@ #include "mongo/db/query/plan_summary_stats.h" #include "mongo/rpc/metadata/client_metadata.h" #include "mongo/rpc/metadata/client_metadata_ismaster.h" +#include "mongo/util/hex.h" #include "mongo/util/log.h" #include "mongo/util/net/socket_utils.h" #include "mongo/util/stringutils.h" @@ -571,6 +574,9 @@ string OpDebug::report(Client* client, s << " numYields:" << curop.numYields(); OPDEBUG_TOSTRING_HELP(nreturned); + if (queryHash) { + s << " queryHash:" << unsignedIntToFixedLengthHex(*queryHash); + } if (!errInfo.isOK()) { s << " ok:" << 0; if (!errInfo.reason().empty()) { @@ -652,6 +658,10 @@ void OpDebug::append(const CurOp& curop, b.appendNumber("numYield", curop.numYields()); OPDEBUG_APPEND_NUMBER(nreturned); + if (queryHash) { + b.append("queryHash", unsignedIntToFixedLengthHex(*queryHash)); + } + { BSONObjBuilder locks(b.subobjStart("locks")); lockStats.report(&locks); |