summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/run_aggregate.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/commands/run_aggregate.cpp')
-rw-r--r--src/mongo/db/commands/run_aggregate.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mongo/db/commands/run_aggregate.cpp b/src/mongo/db/commands/run_aggregate.cpp
index f9e07a9b379..9daa28c57b6 100644
--- a/src/mongo/db/commands/run_aggregate.cpp
+++ b/src/mongo/db/commands/run_aggregate.cpp
@@ -336,9 +336,9 @@ Status runAggregate(OperationContext* opCtx,
unique_ptr<PlanExecutor, PlanExecutor::Deleter> exec;
boost::intrusive_ptr<ExpressionContext> expCtx;
Pipeline* unownedPipeline;
+ const LiteParsedPipeline liteParsedPipeline(request);
auto curOp = CurOp::get(opCtx);
{
- const LiteParsedPipeline liteParsedPipeline(request);
try {
// Check whether the parsed pipeline supports the given read concern.
@@ -558,6 +558,9 @@ Status runAggregate(OperationContext* opCtx,
ScopeGuard cursorFreer = MakeGuard(&ClientCursorPin::deleteUnderlying, &pin);
+ // Report usage statistics for each stage in the pipeline.
+ liteParsedPipeline.tickGlobalStageCounters();
+
// If both explain and cursor are specified, explain wins.
if (expCtx->explain) {
Explain::explainPipelineExecutor(