diff options
author | Randolph Tan <randolph@10gen.com> | 2020-02-27 18:15:47 -0500 |
---|---|---|
committer | Evergreen Agent <no-reply@evergreen.mongodb.com> | 2020-03-02 15:01:43 +0000 |
commit | fa63db9e59c9b45e448c00d5126c68b394ad7585 (patch) | |
tree | 82a6832c07cc85b659ef49b401fde7627da2b53f /src/mongo/db/s/metadata_manager.cpp | |
parent | b40e4076c94283df6f07c3a7e6b88e34b1721e73 (diff) | |
download | mongo-fa63db9e59c9b45e448c00d5126c68b394ad7585.tar.gz |
SERVER-14126 Add range deleter stats for serverStatus under shardingStatistics
Diffstat (limited to 'src/mongo/db/s/metadata_manager.cpp')
-rw-r--r-- | src/mongo/db/s/metadata_manager.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/mongo/db/s/metadata_manager.cpp b/src/mongo/db/s/metadata_manager.cpp index b1551890cdf..96d3b5c75a0 100644 --- a/src/mongo/db/s/metadata_manager.cpp +++ b/src/mongo/db/s/metadata_manager.cpp @@ -279,6 +279,19 @@ void MetadataManager::append(BSONObjBuilder* builder) const { amrArr.done(); } +void MetadataManager::appendForServerStatus(BSONArrayBuilder* builder) const { + auto numRangeDeletes = ([this] { + stdx::lock_guard<Latch> lg(_managerLock); + return _rangesScheduledForDeletion.size(); + })(); + + if (numRangeDeletes > 0) { + BSONObjBuilder statBuilder; + statBuilder.appendNumber(_nss.ns(), numRangeDeletes); + builder->append(statBuilder.obj()); + } +} + SharedSemiFuture<void> MetadataManager::beginReceive(ChunkRange const& range) { stdx::lock_guard<Latch> lg(_managerLock); invariant(!_metadata.empty()); |