diff options
Diffstat (limited to 'src/mongo/db/query/find.cpp')
| -rw-r--r-- | src/mongo/db/query/find.cpp | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/src/mongo/db/query/find.cpp b/src/mongo/db/query/find.cpp index cd8e21bf6c7..d2f36155e13 100644 --- a/src/mongo/db/query/find.cpp +++ b/src/mongo/db/query/find.cpp @@ -107,28 +107,19 @@ void endQueryOp(OperationContext* opCtx, const CollectionPtr& collection, const PlanExecutor& exec, long long numResults, - boost::optional<ClientCursorPin&> cursor, - const BSONObj& cmdObj) { + CursorId cursorId) { auto curOp = CurOp::get(opCtx); - // Fill out basic CurOp query exec properties. More metrics (nreturned and executionTime) - // are collected within collectQueryStatsMongod. - curOp->debug().cursorid = (cursor.has_value() ? cursor->getCursor()->cursorid() : -1); - curOp->debug().cursorExhausted = !cursor.has_value(); - curOp->debug().additiveMetrics.nBatches = 1; + // Fill out basic CurOp query exec properties. + curOp->debug().nreturned = numResults; + curOp->debug().cursorid = (0 == cursorId ? -1 : cursorId); + curOp->debug().cursorExhausted = (0 == cursorId); // Fill out CurOp based on explain summary statistics. PlanSummaryStats summaryStats; auto&& explainer = exec.getPlanExplainer(); explainer.getSummaryStats(&summaryStats); curOp->debug().setPlanSummaryMetrics(summaryStats); - curOp->setEndOfOpMetrics(numResults); - - if (cursor) { - collectQueryStatsMongod(opCtx, *cursor); - } else { - collectQueryStatsMongod(opCtx, std::move(curOp->debug().queryStatsInfo.key)); - } if (collection) { CollectionQueryInfo::get(collection).notifyOfQuery(opCtx, collection, summaryStats); |
