summaryrefslogtreecommitdiff
path: root/src/mongo/db
diff options
context:
space:
mode:
authorArun Banala <arun.banala@mongodb.com>2019-01-29 19:05:06 +0000
committerArun Banala <arun.banala@mongodb.com>2019-01-30 16:14:34 +0000
commitfe4671796898defd5ef74a22b4caecbfc6113e8e (patch)
tree52244dfd6d878ad4cba8d1c6e53c34a322220f0d /src/mongo/db
parent83a272651d4fecf9a4bbe9a7fcbc403f5bf657c6 (diff)
downloadmongo-fe4671796898defd5ef74a22b4caecbfc6113e8e.tar.gz
SERVER-37315 Remove 'nmoved' and 'incrementNmoved()' from OpDebug
Diffstat (limited to 'src/mongo/db')
-rw-r--r--src/mongo/db/curop.cpp14
-rw-r--r--src/mongo/db/curop.h7
-rw-r--r--src/mongo/db/curop_test.cpp10
-rw-r--r--src/mongo/db/transaction_participant_test.cpp12
4 files changed, 4 insertions, 39 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index e47d46452cf..90742defe81 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -639,7 +639,6 @@ string OpDebug::report(Client* client,
OPDEBUG_TOSTRING_HELP_BOOL(upsert);
OPDEBUG_TOSTRING_HELP_BOOL(cursorExhausted);
- OPDEBUG_TOSTRING_HELP_OPTIONAL("nmoved", additiveMetrics.nmoved);
OPDEBUG_TOSTRING_HELP_OPTIONAL("keysInserted", additiveMetrics.keysInserted);
OPDEBUG_TOSTRING_HELP_OPTIONAL("keysDeleted", additiveMetrics.keysDeleted);
OPDEBUG_TOSTRING_HELP_OPTIONAL("prepareReadConflicts", additiveMetrics.prepareReadConflicts);
@@ -731,7 +730,6 @@ void OpDebug::append(const CurOp& curop,
OPDEBUG_APPEND_BOOL(upsert);
OPDEBUG_APPEND_BOOL(cursorExhausted);
- OPDEBUG_APPEND_OPTIONAL("nmoved", additiveMetrics.nmoved);
OPDEBUG_APPEND_OPTIONAL("keysInserted", additiveMetrics.keysInserted);
OPDEBUG_APPEND_OPTIONAL("keysDeleted", additiveMetrics.keysDeleted);
OPDEBUG_APPEND_OPTIONAL("prepareReadConflicts", additiveMetrics.prepareReadConflicts);
@@ -811,7 +809,6 @@ void OpDebug::AdditiveMetrics::add(const AdditiveMetrics& otherMetrics) {
nModified = addOptionalLongs(nModified, otherMetrics.nModified);
ninserted = addOptionalLongs(ninserted, otherMetrics.ninserted);
ndeleted = addOptionalLongs(ndeleted, otherMetrics.ndeleted);
- nmoved = addOptionalLongs(nmoved, otherMetrics.nmoved);
keysInserted = addOptionalLongs(keysInserted, otherMetrics.keysInserted);
keysDeleted = addOptionalLongs(keysDeleted, otherMetrics.keysDeleted);
prepareReadConflicts =
@@ -823,8 +820,7 @@ bool OpDebug::AdditiveMetrics::equals(const AdditiveMetrics& otherMetrics) {
return keysExamined == otherMetrics.keysExamined && docsExamined == otherMetrics.docsExamined &&
nMatched == otherMetrics.nMatched && nModified == otherMetrics.nModified &&
ninserted == otherMetrics.ninserted && ndeleted == otherMetrics.ndeleted &&
- nmoved == otherMetrics.nmoved && keysInserted == otherMetrics.keysInserted &&
- keysDeleted == otherMetrics.keysDeleted &&
+ keysInserted == otherMetrics.keysInserted && keysDeleted == otherMetrics.keysDeleted &&
prepareReadConflicts == otherMetrics.prepareReadConflicts &&
writeConflicts == otherMetrics.writeConflicts;
}
@@ -850,13 +846,6 @@ void OpDebug::AdditiveMetrics::incrementKeysDeleted(long long n) {
*keysDeleted += n;
}
-void OpDebug::AdditiveMetrics::incrementNmoved(long long n) {
- if (!nmoved) {
- nmoved = 0;
- }
- *nmoved += n;
-}
-
void OpDebug::AdditiveMetrics::incrementNinserted(long long n) {
if (!ninserted) {
ninserted = 0;
@@ -880,7 +869,6 @@ string OpDebug::AdditiveMetrics::report() const {
OPDEBUG_TOSTRING_HELP_OPTIONAL("nModified", nModified);
OPDEBUG_TOSTRING_HELP_OPTIONAL("ninserted", ninserted);
OPDEBUG_TOSTRING_HELP_OPTIONAL("ndeleted", ndeleted);
- OPDEBUG_TOSTRING_HELP_OPTIONAL("nmoved", nmoved);
OPDEBUG_TOSTRING_HELP_OPTIONAL("keysInserted", keysInserted);
OPDEBUG_TOSTRING_HELP_OPTIONAL("keysDeleted", keysDeleted);
OPDEBUG_TOSTRING_HELP_OPTIONAL("prepareReadConflicts", prepareReadConflicts);
diff --git a/src/mongo/db/curop.h b/src/mongo/db/curop.h
index 124e3347529..567aea45e61 100644
--- a/src/mongo/db/curop.h
+++ b/src/mongo/db/curop.h
@@ -87,11 +87,6 @@ public:
void incrementKeysDeleted(long long n);
/**
- * Increments nmoved by n.
- */
- void incrementNmoved(long long n);
-
- /**
* Increments ninserted by n.
*/
void incrementNinserted(long long n);
@@ -118,8 +113,6 @@ public:
boost::optional<long long> ninserted;
boost::optional<long long> ndeleted;
- // Updates resulted in a move (moves are expensive).
- boost::optional<long long> nmoved;
// Number of index keys inserted.
boost::optional<long long> keysInserted;
// Number of index keys removed.
diff --git a/src/mongo/db/curop_test.cpp b/src/mongo/db/curop_test.cpp
index de57c571bcc..15be15e4406 100644
--- a/src/mongo/db/curop_test.cpp
+++ b/src/mongo/db/curop_test.cpp
@@ -57,8 +57,6 @@ TEST(CurOpTest, AddingAdditiveMetricsObjectsTogetherShouldAddFieldsTogether) {
additiveMetricsToAdd.ninserted = 0;
currentAdditiveMetrics.ndeleted = 3;
additiveMetricsToAdd.ndeleted = 2;
- currentAdditiveMetrics.nmoved = 0;
- additiveMetricsToAdd.nmoved = 4;
currentAdditiveMetrics.keysInserted = 6;
additiveMetricsToAdd.keysInserted = 5;
currentAdditiveMetrics.keysDeleted = 4;
@@ -85,8 +83,6 @@ TEST(CurOpTest, AddingAdditiveMetricsObjectsTogetherShouldAddFieldsTogether) {
*additiveMetricsBeforeAdd.ninserted + *additiveMetricsToAdd.ninserted);
ASSERT_EQ(*currentAdditiveMetrics.ndeleted,
*additiveMetricsBeforeAdd.ndeleted + *additiveMetricsToAdd.ndeleted);
- ASSERT_EQ(*currentAdditiveMetrics.nmoved,
- *additiveMetricsBeforeAdd.nmoved + *additiveMetricsToAdd.nmoved);
ASSERT_EQ(*currentAdditiveMetrics.keysInserted,
*additiveMetricsBeforeAdd.keysInserted + *additiveMetricsToAdd.keysInserted);
ASSERT_EQ(*currentAdditiveMetrics.keysDeleted,
@@ -107,8 +103,6 @@ TEST(CurOpTest, AddingUninitializedAdditiveMetricsFieldsShouldBeTreatedAsZero) {
currentAdditiveMetrics.docsExamined = 4;
currentAdditiveMetrics.nModified = 3;
additiveMetricsToAdd.ninserted = 0;
- currentAdditiveMetrics.nmoved = 0;
- additiveMetricsToAdd.nmoved = 4;
currentAdditiveMetrics.keysInserted = 6;
additiveMetricsToAdd.keysInserted = 5;
currentAdditiveMetrics.keysDeleted = 4;
@@ -135,8 +129,6 @@ TEST(CurOpTest, AddingUninitializedAdditiveMetricsFieldsShouldBeTreatedAsZero) {
ASSERT_EQ(currentAdditiveMetrics.nMatched, boost::none);
// The following field values should have changed after adding.
- ASSERT_EQ(*currentAdditiveMetrics.nmoved,
- *additiveMetricsBeforeAdd.nmoved + *additiveMetricsToAdd.nmoved);
ASSERT_EQ(*currentAdditiveMetrics.keysInserted,
*additiveMetricsBeforeAdd.keysInserted + *additiveMetricsToAdd.keysInserted);
ASSERT_EQ(*currentAdditiveMetrics.keysDeleted,
@@ -160,14 +152,12 @@ TEST(CurOpTest, AdditiveMetricsFieldsShouldIncrementByN) {
additiveMetrics.incrementWriteConflicts(1);
additiveMetrics.incrementKeysInserted(5);
additiveMetrics.incrementKeysDeleted(0);
- additiveMetrics.incrementNmoved(1);
additiveMetrics.incrementNinserted(3);
additiveMetrics.incrementPrepareReadConflicts(2);
ASSERT_EQ(*additiveMetrics.writeConflicts, 2);
ASSERT_EQ(*additiveMetrics.keysInserted, 7);
ASSERT_EQ(*additiveMetrics.keysDeleted, 0);
- ASSERT_EQ(*additiveMetrics.nmoved, 1);
ASSERT_EQ(*additiveMetrics.ninserted, 3);
ASSERT_EQ(*additiveMetrics.prepareReadConflicts, 8);
}
diff --git a/src/mongo/db/transaction_participant_test.cpp b/src/mongo/db/transaction_participant_test.cpp
index 53e3c46a1da..70c55ab773e 100644
--- a/src/mongo/db/transaction_participant_test.cpp
+++ b/src/mongo/db/transaction_participant_test.cpp
@@ -2431,8 +2431,6 @@ TEST_F(TransactionsMetricsTest, AdditiveMetricsObjectsShouldBeAddedTogetherUponS
txnParticipant->getSingleTransactionStatsForTest().getOpDebug()->additiveMetrics.nModified = 1;
CurOp::get(opCtx())->debug().additiveMetrics.nModified = 1;
CurOp::get(opCtx())->debug().additiveMetrics.ninserted = 4;
- txnParticipant->getSingleTransactionStatsForTest().getOpDebug()->additiveMetrics.nmoved = 3;
- CurOp::get(opCtx())->debug().additiveMetrics.nmoved = 2;
txnParticipant->getSingleTransactionStatsForTest().getOpDebug()->additiveMetrics.keysInserted =
1;
CurOp::get(opCtx())->debug().additiveMetrics.keysInserted = 1;
@@ -2514,8 +2512,6 @@ TEST_F(TransactionsMetricsTest, AdditiveMetricsObjectsShouldBeAddedTogetherUponA
txnParticipant->getSingleTransactionStatsForTest().getOpDebug()->additiveMetrics.nModified = 0;
CurOp::get(opCtx())->debug().additiveMetrics.nModified = 3;
CurOp::get(opCtx())->debug().additiveMetrics.ndeleted = 5;
- txnParticipant->getSingleTransactionStatsForTest().getOpDebug()->additiveMetrics.nmoved = 0;
- CurOp::get(opCtx())->debug().additiveMetrics.nmoved = 2;
txnParticipant->getSingleTransactionStatsForTest().getOpDebug()->additiveMetrics.keysInserted =
1;
CurOp::get(opCtx())->debug().additiveMetrics.keysInserted = 1;
@@ -2955,7 +2951,6 @@ void setupAdditiveMetrics(const int metricValue, OperationContext* opCtx) {
CurOp::get(opCtx)->debug().additiveMetrics.nModified = metricValue;
CurOp::get(opCtx)->debug().additiveMetrics.ninserted = metricValue;
CurOp::get(opCtx)->debug().additiveMetrics.ndeleted = metricValue;
- CurOp::get(opCtx)->debug().additiveMetrics.nmoved = metricValue;
CurOp::get(opCtx)->debug().additiveMetrics.keysInserted = metricValue;
CurOp::get(opCtx)->debug().additiveMetrics.keysDeleted = metricValue;
CurOp::get(opCtx)->debug().additiveMetrics.prepareReadConflicts = metricValue;
@@ -2985,9 +2980,8 @@ void buildSingleTransactionStatsString(StringBuilder* sb, const int metricValue)
(*sb) << " keysExamined:" << metricValue << " docsExamined:" << metricValue
<< " nMatched:" << metricValue << " nModified:" << metricValue
<< " ninserted:" << metricValue << " ndeleted:" << metricValue
- << " nmoved:" << metricValue << " keysInserted:" << metricValue
- << " keysDeleted:" << metricValue << " prepareReadConflicts:" << metricValue
- << " writeConflicts:" << metricValue;
+ << " keysInserted:" << metricValue << " keysDeleted:" << metricValue
+ << " prepareReadConflicts:" << metricValue << " writeConflicts:" << metricValue;
}
/*
@@ -3080,7 +3074,7 @@ std::string buildTransactionInfoString(
// parameters:{ lsid: { id: UUID("f825288c-100e-49a1-9fd7-b95c108049e6"), uid: BinData(0,
// E3B0C44298FC1C149AFBF4C8996FB92427AE41E4649B934CA495991B7852B855) }, txnNumber: 1,
// autocommit: false }, readTimestamp:Timestamp(0, 0), keysExamined:1 docsExamined:1 nMatched:1
- // nModified:1 ninserted:1 ndeleted:1 nmoved:1 keysInserted:1 keysDeleted:1
+ // nModified:1 ninserted:1 ndeleted:1 keysInserted:1 keysDeleted:1
// prepareReadConflicts:1 writeConflicts:1 terminationCause:committed timeActiveMicros:3
// timeInactiveMicros:2 numYields:0 locks:{ Global: { acquireCount: { r: 6, w: 4 } }, Database:
// { acquireCount: { r: 1, w: 1, W: 2 } }, Collection: { acquireCount: { R: 1 } }, oplog: {