diff options
author | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-10-02 17:12:12 -0400 |
---|---|---|
committer | Ted Tuckman <ted.tuckman@mongodb.com> | 2018-10-09 10:59:41 -0400 |
commit | addc24e5dcc8c2053df56697d35162a8776446e5 (patch) | |
tree | 16990f2d3dccbfe5e9e7f360339b04c98fd85077 /src/mongo/db/clientcursor.cpp | |
parent | 3dc5e5979bc9a4a914b0a479e88e70078bd02552 (diff) | |
download | mongo-addc24e5dcc8c2053df56697d35162a8776446e5.tar.gz |
SERVER-37007 Add planSummary to idleCursor
Diffstat (limited to 'src/mongo/db/clientcursor.cpp')
-rw-r--r-- | src/mongo/db/clientcursor.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/clientcursor.cpp b/src/mongo/db/clientcursor.cpp index 756f1fbc7eb..92e6a1ffb30 100644 --- a/src/mongo/db/clientcursor.cpp +++ b/src/mongo/db/clientcursor.cpp @@ -47,6 +47,7 @@ #include "mongo/db/commands/server_status_metric.h" #include "mongo/db/cursor_server_params.h" #include "mongo/db/jsobj.h" +#include "mongo/db/query/explain.h" #include "mongo/db/repl/repl_client_info.h" #include "mongo/db/repl/replication_coordinator.h" #include "mongo/util/background.h" @@ -92,7 +93,8 @@ ClientCursor::ClientCursor(ClientCursorParams params, _exec(std::move(params.exec)), _operationUsingCursor(operationUsingCursor), _lastUseDate(now), - _createdDate(now) { + _createdDate(now), + _planSummary(Explain::getPlanSummary(_exec.get())) { invariant(_cursorManager); invariant(_exec); invariant(_operationUsingCursor); @@ -143,6 +145,7 @@ GenericCursor ClientCursor::toGenericCursor() const { gc.setLastAccessDate(getLastUseDate()); gc.setCreatedDate(getCreatedDate()); gc.setNBatchesReturned(getNBatches()); + gc.setPlanSummary(getPlanSummary()); if (auto opCtx = _operationUsingCursor) { gc.setOperationUsingCursorId(opCtx->getOpID()); } |