summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGregory Wlodarek <gregory.wlodarek@mongodb.com>2020-11-09 20:00:15 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2020-11-10 15:46:23 +0000
commit1761282aff97de315fe1f232c780e0a9fb998799 (patch)
tree012322e4cdeac6f8af9bcf1e6425b4b3eb0642cc
parent6687f921bad12aa30e264d00d006a1d9078bb8bd (diff)
downloadmongo-1761282aff97de315fe1f232c780e0a9fb998799.tar.gz
SERVER-52724 Increment TTL passes server status metric after the TTL work has finished
-rw-r--r--src/mongo/db/ttl.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/mongo/db/ttl.cpp b/src/mongo/db/ttl.cpp
index d984ea9e9bb..5cdbcd9b80f 100644
--- a/src/mongo/db/ttl.cpp
+++ b/src/mongo/db/ttl.cpp
@@ -186,7 +186,8 @@ private:
// Pair of collection namespace and index spec.
std::vector<std::pair<NamespaceString, BSONObj>> ttlIndexes;
- ttlPasses.increment();
+ // Increment the metric after the TTL work has been finished.
+ ON_BLOCK_EXIT([&] { ttlPasses.increment(); });
// Get all TTL indexes from every collection.
for (const std::pair<UUID, std::string>& ttlInfo : ttlInfos) {