summaryrefslogtreecommitdiff
path: root/src/mongo/db/commands/write_commands.cpp
diff options
context:
space:
mode:
authorAdi Zaimi <adizaimi@yahoo.com>2022-11-10 20:52:04 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-10 21:22:25 +0000
commit553067485afc74087de94ef11298a02298524fae (patch)
tree17dc83ff2fb04e4af05e26e74443f966ebf7647b /src/mongo/db/commands/write_commands.cpp
parent4092dfdb884994df0a45688f190bc1473adbeffe (diff)
downloadmongo-553067485afc74087de94ef11298a02298524fae.tar.gz
SERVER-67795: Add serverstatus counters for updateMany, deleteMany calls(6.1)
Diffstat (limited to 'src/mongo/db/commands/write_commands.cpp')
-rw-r--r--src/mongo/db/commands/write_commands.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mongo/db/commands/write_commands.cpp b/src/mongo/db/commands/write_commands.cpp
index 0ddf1c96316..daf86320f19 100644
--- a/src/mongo/db/commands/write_commands.cpp
+++ b/src/mongo/db/commands/write_commands.cpp
@@ -1559,6 +1559,9 @@ public:
if (update.getArrayFilters()) {
CmdUpdate::updateMetrics.incrementExecutedWithArrayFilters();
}
+ if (update.getMulti()) {
+ updateManyCount.increment(1);
+ }
}
return updateReply;
@@ -1717,6 +1720,13 @@ public:
std::move(reply),
&deleteReply);
+ // Collect metrics.
+ for (auto&& deletes : request().getDeletes()) {
+ if (deletes.getMulti()) {
+ deleteManyCount.increment(1);
+ }
+ }
+
return deleteReply;
} catch (const DBException& ex) {
NotPrimaryErrorTracker::get(opCtx->getClient()).recordError(ex.code());