summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEliot Horowitz <eliot@10gen.com>2011-10-02 22:51:51 -0400
committerEliot Horowitz <eliot@10gen.com>2011-10-02 22:52:59 -0400
commit4063312d6044196be67fd29c6daac8768f6f6110 (patch)
tree7888939046643114570a8cfa51d6faaf686ddda6
parent729ad802c8df1f4537b6d1a2ddcdc9a2b697bb13 (diff)
downloadmongo-4063312d6044196be67fd29c6daac8768f6f6110.tar.gz
setProfilingLevel(2) not always working because millis set in wrong place SERVER-3910
-rw-r--r--db/instance.cpp9
1 files changed, 4 insertions, 5 deletions
diff --git a/db/instance.cpp b/db/instance.cpp
index 6727867aa19..764571d92e5 100644
--- a/db/instance.cpp
+++ b/db/instance.cpp
@@ -353,20 +353,19 @@ namespace mongo {
}
currentOp.ensureStarted();
currentOp.done();
- int ms = currentOp.totalTimeMillis();
+ debug.executionTime = currentOp.totalTimeMillis();
//DEV log = true;
- if ( log || ms > logThreshold ) {
- if( logLevel < 3 && op == dbGetMore && strstr(ns, ".oplog.") && ms < 4300 && !log ) {
+ if ( log || debug.executionTime > logThreshold ) {
+ if( logLevel < 3 && op == dbGetMore && strstr(ns, ".oplog.") && debug.executionTime < 4300 && !log ) {
/* it's normal for getMore on the oplog to be slow because of use of awaitdata flag. */
}
else {
- debug.executionTime = ms;
mongo::tlog() << debug << endl;
}
}
- if ( currentOp.shouldDBProfile( ms ) ) {
+ if ( currentOp.shouldDBProfile( debug.executionTime ) ) {
// performance profiling is on
if ( dbMutex.getState() < 0 ) {
mongo::log(1) << "note: not profiling because recursive read lock" << endl;