summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHari Khalsa <hkhalsa@10gen.com>2014-01-13 16:53:53 -0500
committerHari Khalsa <hkhalsa@10gen.com>2014-01-14 10:28:58 -0500
commit59b0371902b5b278ef1e88a9c15424c6efeea666 (patch)
treef987fa225fec701b80addfcc3d3f25747358fac6
parent9f99f49ceb00fdd2bfdc895baf91a90a24e223c4 (diff)
downloadmongo-59b0371902b5b278ef1e88a9c15424c6efeea666.tar.gz
SERVER-3443 SERVER-7754 add plan exec stats to system profile
-rw-r--r--src/mongo/db/client.cpp4
-rw-r--r--src/mongo/db/curop.h4
-rw-r--r--src/mongo/db/query/new_find.cpp10
3 files changed, 15 insertions, 3 deletions
diff --git a/src/mongo/db/client.cpp b/src/mongo/db/client.cpp
index 1e5e8b43367..2c4fd5b885b 100644
--- a/src/mongo/db/client.cpp
+++ b/src/mongo/db/client.cpp
@@ -729,6 +729,10 @@ namespace mongo {
OPDEBUG_APPEND_NUMBER( responseLength );
b.append( "millis" , executionTime );
+ if (!execStats.isEmpty()) {
+ b.append("execStats", execStats);
+ }
+
return true;
}
diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h
index eed53648a81..3af7962c712 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -102,6 +102,10 @@ namespace mongo {
bool upsert; // true if the update actually did an insert
int keyUpdates;
+ // New Query Framework debugging/profiling info
+ // XXX: should this really be an opaque BSONObj? Not sure.
+ BSONObj execStats;
+
// error handling
ExceptionInfo exceptionInfo;
diff --git a/src/mongo/db/query/new_find.cpp b/src/mongo/db/query/new_find.cpp
index 3a1aa67b641..fe9cc8b40ff 100644
--- a/src/mongo/db/query/new_find.cpp
+++ b/src/mongo/db/query/new_find.cpp
@@ -167,9 +167,7 @@ namespace mongo {
curop.setMaxTimeMicros(cc->getLeftoverMaxTimeMicros());
killCurrentOp.checkForInterrupt(); // May trigger maxTimeAlwaysTimeOut fail point.
- // TODO:
- // curop.debug().query = BSONForQuery
- // curop.setQuery(curop.debug().query);
+ // XXX: what should we set for the curop.debug() etc. here?
// TODO: What is pass?
if (0 == pass) { cc->updateSlaveLocation(curop); }
@@ -217,6 +215,8 @@ namespace mongo {
}
}
+ // XXX: should we update the execution stats in curop.debug() here?
+
if (Runner::RUNNER_EOF == state && 0 == numResults
&& (queryOptions & QueryOption_CursorTailable)
&& (queryOptions & QueryOption_AwaitData) && (pass < 1000)) {
@@ -680,6 +680,10 @@ namespace mongo {
if (explain->isIDHackSet()) {
curop.debug().idhack = explain->getIDHack();
}
+
+ if (!explain->stats.isEmpty()) {
+ curop.debug().execStats = explain->stats;
+ }
}
// curop.debug().exhaust is set above.