summaryrefslogtreecommitdiff
path: root/src/mongo/db/exec/cached_plan.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/mongo/db/exec/cached_plan.cpp')
-rw-r--r--src/mongo/db/exec/cached_plan.cpp14
1 files changed, 14 insertions, 0 deletions
diff --git a/src/mongo/db/exec/cached_plan.cpp b/src/mongo/db/exec/cached_plan.cpp
index 874e52fd526..31450fecc89 100644
--- a/src/mongo/db/exec/cached_plan.cpp
+++ b/src/mongo/db/exec/cached_plan.cpp
@@ -69,6 +69,9 @@ namespace mongo {
PlanStage::StageState CachedPlanStage::work(WorkingSetID* out) {
++_commonStats.works;
+ // Adds the amount of time taken by work() to executionTimeMillis.
+ ScopedTimer timer(&_commonStats.executionTimeMillis);
+
if (isEOF()) { return PlanStage::IS_EOF; }
StageState childStatus = getActiveChild()->work(out);
@@ -123,6 +126,17 @@ namespace mongo {
++_commonStats.invalidates;
}
+ vector<PlanStage*> CachedPlanStage::getChildren() const {
+ vector<PlanStage*> children;
+ if (_usingBackupChild) {
+ children.push_back(_backupChildPlan.get());
+ }
+ else {
+ children.push_back(_mainChildPlan.get());
+ }
+ return children;
+ }
+
PlanStageStats* CachedPlanStage::getStats() {
_commonStats.isEOF = isEOF();