diff options
Diffstat (limited to 'src/mongo/db/exec/sort.cpp')
-rw-r--r-- | src/mongo/db/exec/sort.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/exec/sort.cpp b/src/mongo/db/exec/sort.cpp index b30a198a1c1..7486e415744 100644 --- a/src/mongo/db/exec/sort.cpp +++ b/src/mongo/db/exec/sort.cpp @@ -304,6 +304,9 @@ namespace mongo { PlanStage::StageState SortStage::work(WorkingSetID* out) { ++_commonStats.works; + // Adds the amount of time taken by work() to executionTimeMillis. + ScopedTimer timer(&_commonStats.executionTimeMillis); + if (NULL == _sortKeyGen) { // This is heavy and should be done as part of work(). _sortKeyGen.reset(new SortStageKeyGenerator(_collection, _pattern, _query)); @@ -449,6 +452,12 @@ namespace mongo { } } + vector<PlanStage*> SortStage::getChildren() const { + vector<PlanStage*> children; + children.push_back(_child.get()); + return children; + } + PlanStageStats* SortStage::getStats() { _commonStats.isEOF = isEOF(); _specificStats.memLimit = kMaxBytes; |