summaryrefslogtreecommitdiff
path: root/src/mongo/db/pipeline/plan_explainer_pipeline.cpp
diff options
context:
space:
mode:
authorAnton Korshunov <anton.korshunov@mongodb.com>2021-01-18 22:06:40 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2021-01-30 03:46:12 +0000
commitc088ca3d8fef6d806f92ea2d5869d8910e5cd30c (patch)
treee5d69b3273488d9d0c9aa2894184cc8a7545aac9 /src/mongo/db/pipeline/plan_explainer_pipeline.cpp
parentc08203fe14a89e789b7dc5353c427e34c4c2b31e (diff)
downloadmongo-c088ca3d8fef6d806f92ea2d5869d8910e5cd30c.tar.gz
SERVER-53270 Include SBE PlanStage tree string into explain output
Diffstat (limited to 'src/mongo/db/pipeline/plan_explainer_pipeline.cpp')
-rw-r--r--src/mongo/db/pipeline/plan_explainer_pipeline.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/pipeline/plan_explainer_pipeline.cpp b/src/mongo/db/pipeline/plan_explainer_pipeline.cpp
index 49e05ead917..4b3bcfac0a6 100644
--- a/src/mongo/db/pipeline/plan_explainer_pipeline.cpp
+++ b/src/mongo/db/pipeline/plan_explainer_pipeline.cpp
@@ -50,6 +50,16 @@ void collectPlanSummaryStats(const DocSourceType& source, PlanSummaryStats* stat
statsOut->accumulate(docSpecificStats.planSummaryStats);
}
+const PlanExplainer::ExplainVersion& PlanExplainerPipeline::getVersion() const {
+ static const ExplainVersion kExplainVersion = "1";
+
+ if (auto docSourceCursor =
+ dynamic_cast<DocumentSourceCursor*>(_pipeline->getSources().front().get())) {
+ return docSourceCursor->getExplainVersion();
+ }
+ return kExplainVersion;
+}
+
std::string PlanExplainerPipeline::getPlanSummary() const {
if (auto docSourceCursor =
dynamic_cast<DocumentSourceCursor*>(_pipeline->getSources().front().get())) {