summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authorTed Tuckman <ted.tuckman@mongodb.com>2019-05-17 09:56:27 -0400
committerTed Tuckman <ted.tuckman@mongodb.com>2019-05-23 12:49:01 -0400
commita8b1c9040a3f91e8d396f047547d298fb44d7df0 (patch)
tree8f30db6301a9def523cc59738c2559aff04f53a2 /src/mongo/db/curop.cpp
parentf2b7b6ecde3f3e6d164609163129ccbebb1426d7 (diff)
downloadmongo-a8b1c9040a3f91e8d396f047547d298fb44d7df0.tar.gz
SERVER-40416 Add logging to fts document source
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r--src/mongo/db/curop.cpp16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index de531be80e8..42ef17cf216 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -659,6 +659,9 @@ string OpDebug::report(Client* client,
OPDEBUG_TOSTRING_HELP(nShards);
OPDEBUG_TOSTRING_HELP(cursorid);
+ if (mongotCursorId) {
+ s << " mongot: " << makeSearchBetaObject().toString();
+ }
OPDEBUG_TOSTRING_HELP(ntoreturn);
OPDEBUG_TOSTRING_HELP(ntoskip);
OPDEBUG_TOSTRING_HELP_BOOL(exhaust);
@@ -761,6 +764,9 @@ void OpDebug::append(const CurOp& curop,
OPDEBUG_APPEND_NUMBER(nShards);
OPDEBUG_APPEND_NUMBER(cursorid);
+ if (mongotCursorId) {
+ b.append("mongot", makeSearchBetaObject());
+ }
OPDEBUG_APPEND_BOOL(exhaust);
OPDEBUG_APPEND_OPTIONAL("keysExamined", additiveMetrics.keysExamined);
@@ -856,6 +862,16 @@ BSONObj OpDebug::makeFlowControlObject(FlowControlTicketholder::CurOp stats) con
return builder.obj();
}
+BSONObj OpDebug::makeSearchBetaObject() const {
+ BSONObjBuilder cursorBuilder;
+ invariant(mongotCursorId);
+ cursorBuilder.append("cursorid", mongotCursorId.get());
+ if (msWaitingForMongot) {
+ cursorBuilder.append("timeWaitingMillis", msWaitingForMongot.get());
+ }
+ return cursorBuilder.obj();
+}
+
namespace {