diff options
author | Aaron <aaron@10gen.com> | 2012-02-20 20:37:35 -0800 |
---|---|---|
committer | Aaron <aaron@10gen.com> | 2012-02-24 22:49:15 -0800 |
commit | c8ff3791143b2bc34c6d61e5b15e5e7a69f5da27 (patch) | |
tree | 48459b9e78e9413f0f632a7646d883acd4703214 /src | |
parent | 9069aa464c3b44a9e8a2f3f97994268bec255bda (diff) | |
download | mongo-c8ff3791143b2bc34c6d61e5b15e5e7a69f5da27.tar.gz |
SERVER-4150 include additional explain infomation for geo cursors
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/explain.cpp | 32 | ||||
-rw-r--r-- | src/mongo/db/explain.h | 1 |
2 files changed, 20 insertions, 13 deletions
diff --git a/src/mongo/db/explain.cpp b/src/mongo/db/explain.cpp index 27e5014c79e..2b068d5fde8 100644 --- a/src/mongo/db/explain.cpp +++ b/src/mongo/db/explain.cpp @@ -60,6 +60,9 @@ namespace mongo { void ExplainPlanInfo::noteDone( const Cursor &cursor ) { _done = true; noteCursorUpdate( cursor ); + BSONObjBuilder bob; + const_cast<Cursor&>(cursor).explainDetails( bob ); + _details = bob.obj(); } void ExplainPlanInfo::notePicked() { @@ -77,19 +80,22 @@ namespace mongo { } BSONObj ExplainPlanInfo::pickedPlanBson( const ExplainClauseInfo &clauseInfo ) const { - return BSON( - "cursor" << _cursorName << - "isMultiKey" << _isMultiKey << - "n" << clauseInfo.n() << - "nscannedObjects" << clauseInfo.nscannedObjects() << - "nscanned" << clauseInfo.nscanned() << - "scanAndOrder" << _scanAndOrder << - "indexOnly" << _indexOnly << - "nYields" << _nYields << - "nChunkSkips" << clauseInfo.nChunkSkips() << - "millis" << clauseInfo.millis() << - "indexBounds" << _indexBounds - ); + BSONObjBuilder bob; + bob << + "cursor" << _cursorName << + "isMultiKey" << _isMultiKey << + "n" << clauseInfo.n() << + "nscannedObjects" << clauseInfo.nscannedObjects() << + "nscanned" << clauseInfo.nscanned() << + "scanAndOrder" << _scanAndOrder << + "indexOnly" << _indexOnly << + "nYields" << _nYields << + "nChunkSkips" << clauseInfo.nChunkSkips() << + "millis" << clauseInfo.millis() << + "indexBounds" << _indexBounds + ; + bob.appendElements( _details ); + return bob.obj(); } void ExplainPlanInfo::noteCursorUpdate( const Cursor &cursor ) { diff --git a/src/mongo/db/explain.h b/src/mongo/db/explain.h index b1eb7e49f85..324e3a061a2 100644 --- a/src/mongo/db/explain.h +++ b/src/mongo/db/explain.h @@ -67,6 +67,7 @@ namespace mongo { BSONObj _indexBounds; bool _picked; bool _done; + BSONObj _details; }; class ExplainClauseInfo { |