summaryrefslogtreecommitdiff
path: root/src/mongo/db/stats
diff options
context:
space:
mode:
authorCheahuychou Mao <mao.cheahuychou@gmail.com>2022-11-11 18:03:56 +0000
committerEvergreen Agent <no-reply@evergreen.mongodb.com>2022-11-11 18:56:02 +0000
commit10f9ad49bd128b6b95804f12a641cbab684a34ca (patch)
tree362cf056dfe8078aae8d05c196f1f7be09a05ca1 /src/mongo/db/stats
parent0d67266b5759f89dbf63b72d4d1172c7a421a4a2 (diff)
downloadmongo-10f9ad49bd128b6b95804f12a641cbab684a34ca.tar.gz
SERVER-71229 Make shardsvr mongod also act as a sampler for query analysis
Diffstat (limited to 'src/mongo/db/stats')
-rw-r--r--src/mongo/db/stats/counters.cpp1
-rw-r--r--src/mongo/db/stats/counters.h8
2 files changed, 9 insertions, 0 deletions
diff --git a/src/mongo/db/stats/counters.cpp b/src/mongo/db/stats/counters.cpp
index 4300e292d02..23ea8c46212 100644
--- a/src/mongo/db/stats/counters.cpp
+++ b/src/mongo/db/stats/counters.cpp
@@ -49,6 +49,7 @@ void OpCounters::_reset() {
_delete->store(0);
_getmore->store(0);
_command->store(0);
+ _nestedAggregate->store(0);
_queryDeprecated->store(0);
diff --git a/src/mongo/db/stats/counters.h b/src/mongo/db/stats/counters.h
index d066202d375..c1f9c0ae8bc 100644
--- a/src/mongo/db/stats/counters.h
+++ b/src/mongo/db/stats/counters.h
@@ -77,6 +77,10 @@ public:
_checkWrap(&OpCounters::_queryDeprecated, 1);
}
+ void gotNestedAggregate() {
+ _checkWrap(&OpCounters::_nestedAggregate, 1);
+ }
+
BSONObj getObj() const;
// These opcounters record operations that would fail if we were fully enforcing our consistency
@@ -116,6 +120,9 @@ public:
const AtomicWord<long long>* getCommand() const {
return &*_command;
}
+ const AtomicWord<long long>* getNestedAggregate() const {
+ return &*_nestedAggregate;
+ }
const AtomicWord<long long>* getInsertOnExistingDoc() const {
return &*_insertOnExistingDoc;
}
@@ -150,6 +157,7 @@ private:
CacheExclusive<AtomicWord<long long>> _delete;
CacheExclusive<AtomicWord<long long>> _getmore;
CacheExclusive<AtomicWord<long long>> _command;
+ CacheExclusive<AtomicWord<long long>> _nestedAggregate;
CacheExclusive<AtomicWord<long long>> _insertOnExistingDoc;
CacheExclusive<AtomicWord<long long>> _updateOnMissingDoc;