diff options
author | Nathan Louie <nathan.louie@10gen.com> | 2018-06-18 10:53:36 -0400 |
---|---|---|
committer | Nathan Louie <nathan.louie@10gen.com> | 2018-06-25 17:21:30 -0400 |
commit | d28c9472878a9e50196c568848c84d6225036406 (patch) | |
tree | 57b4cf43c5490aea132c4f77e0da5a406f334f28 /src | |
parent | cec7de9fdbfafbbae19ff8fc3194a5573ab6b744 (diff) | |
download | mongo-d28c9472878a9e50196c568848c84d6225036406.tar.gz |
added to class
Diffstat (limited to 'src')
-rw-r--r-- | src/mongo/db/server_transactions_metrics.cpp | 24 | ||||
-rw-r--r-- | src/mongo/db/server_transactions_metrics.h | 16 |
2 files changed, 40 insertions, 0 deletions
diff --git a/src/mongo/db/server_transactions_metrics.cpp b/src/mongo/db/server_transactions_metrics.cpp index 64411409672..5546f184b4e 100644 --- a/src/mongo/db/server_transactions_metrics.cpp +++ b/src/mongo/db/server_transactions_metrics.cpp @@ -51,6 +51,30 @@ ServerTransactionsMetrics* ServerTransactionsMetrics::get(OperationContext* opCt return get(opCtx->getServiceContext()); } +unsigned long long ServerTransactionsMetrics::getCurrentActive() const { + return _currentActive.load(); +} + +void ServerTransactionsMetrics::decrementCurrentActive() { + _currentActive.fetchAndSubtract(1); +} + +void ServerTransactionsMetrics::incrementCurrentActive() { + _currentActive.fetchAndAdd(1); +} + +unsigned long long ServerTransactionsMetrics::getCurrentInactive() const { + return _currentInactive.load(); +} + +void ServerTransactionsMetrics::decrementCurrentInactive() { + _currentInactive.fetchAndSubtract(1); +} + +void ServerTransactionsMetrics::incrementCurrentInactive() { + _currentInactive.fetchAndAdd(1); +} + unsigned long long ServerTransactionsMetrics::getCurrentOpen() const { return _currentOpen.load(); } diff --git a/src/mongo/db/server_transactions_metrics.h b/src/mongo/db/server_transactions_metrics.h index 22892d37944..6ed3aad007c 100644 --- a/src/mongo/db/server_transactions_metrics.h +++ b/src/mongo/db/server_transactions_metrics.h @@ -46,9 +46,19 @@ public: static ServerTransactionsMetrics* get(ServiceContext* service); static ServerTransactionsMetrics* get(OperationContext* opCtx); +<<<<<<< HEAD unsigned long long getCurrentOpen() const; void decrementCurrentOpen(); void incrementCurrentOpen(); +======= + unsigned long long getCurrentActive() const; + void decrementCurrentActive(); + void incrementCurrentActive(); + + unsigned long long getCurrentInactive() const; + void decrementCurrentInactive(); + void incrementCurrentInactive(); +>>>>>>> 40c317ccbb... added to class unsigned long long getTotalStarted() const; void incrementTotalStarted(); @@ -65,6 +75,12 @@ public: void updateStats(TransactionsStats* stats); private: + // The number of multi-document transactions currently active. + AtomicUInt64 _currentActive{0}; + + // The number of multi-document transactions currently inactive. + AtomicUInt64 _currentInactive{0}; + // The total number of open transactions. AtomicUInt64 _currentOpen{0}; |