summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authorJames Wahlin <james.wahlin@10gen.com>2016-04-21 15:55:32 -0400
committerJames Wahlin <james.wahlin@10gen.com>2016-04-21 16:48:06 -0400
commitdc3d30af10b6859124d1ce8790ad8e097d1f06c7 (patch)
tree4cf90aec523a535c5974007a08fcc95e0f8528bb /src/mongo/db/curop.cpp
parent1a371955e7a93f846a5ddddb19f33d6b270a3991 (diff)
downloadmongo-dc3d30af10b6859124d1ce8790ad8e097d1f06c7.tar.gz
SERVER-23271 Add keysInserted and keysDeleted metrics for CRUD ops
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r--src/mongo/db/curop.cpp28
1 files changed, 25 insertions, 3 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index 6b8618b3843..086f0215b82 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -517,7 +517,6 @@ string OpDebug::report(const CurOp& curop, const SingleThreadedLockStats& lockSt
OPDEBUG_TOSTRING_HELP_BOOL(hasSortStage);
OPDEBUG_TOSTRING_HELP_BOOL(fromMultiPlanner);
OPDEBUG_TOSTRING_HELP_BOOL(replanned);
- OPDEBUG_TOSTRING_HELP(nmoved);
OPDEBUG_TOSTRING_HELP(nMatched);
OPDEBUG_TOSTRING_HELP(nModified);
OPDEBUG_TOSTRING_HELP(ninserted);
@@ -528,6 +527,18 @@ string OpDebug::report(const CurOp& curop, const SingleThreadedLockStats& lockSt
OPDEBUG_TOSTRING_HELP_BOOL(cursorExhausted);
OPDEBUG_TOSTRING_HELP(keyUpdates);
+ if (nmoved > 0) {
+ s << " nmoved:" << nmoved;
+ }
+
+ if (keysInserted > 0) {
+ s << " keysInserted:" << keysInserted;
+ }
+
+ if (keysDeleted > 0) {
+ s << " keysDeleted:" << keysDeleted;
+ }
+
if (writeConflicts > 0) {
s << " writeConflicts:" << writeConflicts;
}
@@ -638,8 +649,6 @@ void OpDebug::append(const CurOp& curop,
OPDEBUG_APPEND_BOOL(hasSortStage);
OPDEBUG_APPEND_BOOL(fromMultiPlanner);
OPDEBUG_APPEND_BOOL(replanned);
- OPDEBUG_APPEND_BOOL(moved);
- OPDEBUG_APPEND_NUMBER(nmoved);
OPDEBUG_APPEND_NUMBER(nMatched);
OPDEBUG_APPEND_NUMBER(nModified);
OPDEBUG_APPEND_NUMBER(ninserted);
@@ -649,6 +658,19 @@ void OpDebug::append(const CurOp& curop,
OPDEBUG_APPEND_BOOL(upsert);
OPDEBUG_APPEND_BOOL(cursorExhausted);
OPDEBUG_APPEND_NUMBER(keyUpdates);
+ OPDEBUG_APPEND_BOOL(moved);
+
+ if (nmoved > 0) {
+ b.appendNumber("nmoved", nmoved);
+ }
+
+ if (keysInserted > 0) {
+ b.appendNumber("keysInserted", keysInserted);
+ }
+
+ if (keysDeleted > 0) {
+ b.appendNumber("keysDeleted", keysDeleted);
+ }
if (writeConflicts > 0) {
b.appendNumber("writeConflicts", writeConflicts);