summaryrefslogtreecommitdiff
path: root/src/mongo/db/curop.cpp
diff options
context:
space:
mode:
authorjinichu <jinnybyun@gmail.com>2018-07-09 16:20:51 -0400
committerjinichu <jinnybyun@gmail.com>2018-07-09 16:20:51 -0400
commitf7dbf6f03397ef6317d8e9dc7bbb32e41a0745d1 (patch)
treeeb83afc22ed93af2fd08e534b0665173d1133713 /src/mongo/db/curop.cpp
parent53be2bca4962b281e7b1cc17742d8c857a338aa4 (diff)
downloadmongo-f7dbf6f03397ef6317d8e9dc7bbb32e41a0745d1.tar.gz
SERVER-35434 Added an OpDebug object to SingleTransactionStats to track aggregate OpDebug stats
Diffstat (limited to 'src/mongo/db/curop.cpp')
-rw-r--r--src/mongo/db/curop.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/curop.cpp b/src/mongo/db/curop.cpp
index bc61bb30574..df504a19ca2 100644
--- a/src/mongo/db/curop.cpp
+++ b/src/mongo/db/curop.cpp
@@ -722,6 +722,16 @@ void OpDebug::AdditiveMetrics::add(const AdditiveMetrics& otherMetrics) {
writeConflicts = addOptionalLongs(writeConflicts, otherMetrics.writeConflicts);
}
+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 &&
+ prepareReadConflicts == otherMetrics.prepareReadConflicts &&
+ writeConflicts == otherMetrics.writeConflicts;
+}
+
void OpDebug::AdditiveMetrics::incrementWriteConflicts(long long n) {
if (!writeConflicts) {
writeConflicts = 0;