summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authorHaley Connelly <haley.connelly@10gen.com>2018-07-31 18:27:03 -0400
committerHaley Connelly <haley.connelly@10gen.com>2018-07-31 18:34:33 -0400
commit075d7fe467e12aa3dfa19aff27672a7a5b34aff0 (patch)
treefe54aa2b9079fd063b08a1fca09f195f12354ef8 /src/mongo/db/curop.cpp
parent6711ab3bbc02ca98da1af2fe115f07e37bb076e4 (diff)
downloadmongo-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.cpp10
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);